Class: RubyCord::Message::Sticker

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycord/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.



115
116
117
118
119
# File 'lib/rubycord/message_meta.rb', line 115

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

Instance Attribute Details

#formatSymbol (readonly)

Returns The sticker format.

Returns:

  • (Symbol)

    The sticker format.



113
114
115
# File 'lib/rubycord/message_meta.rb', line 113

def format
  @format
end

#idRubyCord::Snowflake (readonly)

Returns The sticker ID.

Returns:



109
110
111
# File 'lib/rubycord/message_meta.rb', line 109

def id
  @id
end

#nameString (readonly)

Returns The sticker name.

Returns:

  • (String)

    The sticker name.



111
112
113
# File 'lib/rubycord/message_meta.rb', line 111

def name
  @name
end

Instance Method Details

#inspectObject



121
122
123
# File 'lib/rubycord/message_meta.rb', line 121

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