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.



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

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

Instance Attribute Details

#formatSymbol (readonly)

Returns The sticker format.

Returns:

  • (Symbol)

    The sticker format.



112
113
114
# File 'lib/discorb/message_meta.rb', line 112

def format
  @format
end

#idDiscorb::Snowflake (readonly)

Returns The sticker ID.

Returns:



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

def id
  @id
end

#nameString (readonly)

Returns The sticker name.

Returns:

  • (String)

    The sticker name.



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

def name
  @name
end

Instance Method Details

#inspectObject



120
121
122
# File 'lib/discorb/message_meta.rb', line 120

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