Class: Discorb::Message::Sticker

Inherits:
Object
  • Object
show all
Defined in:
lib/discorb/message_meta.rb

Overview

Represents a sticker.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) -> Sticker

Returns a new instance of Sticker.



109
110
111
112
113
# File 'lib/discorb/message_meta.rb', line 109

def initialize(data)
  @id = Snowflake.new(data[:id])
  @name = data[:name]
  @format = Discorb::Sticker::STICKER_FORMAT[data[:format]]
end

Instance Attribute Details

#format -> Symbol (readonly)

Returns The sticker format.

Returns:

  • (Symbol)

    The sticker format.



107
108
109
# File 'lib/discorb/message_meta.rb', line 107

def format
  @format
end

#id -> Discorb::Snowflake (readonly)

Returns The sticker ID.

Returns:



103
104
105
# File 'lib/discorb/message_meta.rb', line 103

def id
  @id
end

#name -> String (readonly)

Returns The sticker name.

Returns:

  • (String)

    The sticker name.



105
106
107
# File 'lib/discorb/message_meta.rb', line 105

def name
  @name
end

Instance Method Details

#inspect -> Object



115
116
117
# File 'lib/discorb/message_meta.rb', line 115

def inspect
  "#<#{self.class.name} #{@id}: #{@name} format=#{@format}>"
end