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.



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

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.



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

def format
  @format
end

#id -> Discorb::Snowflake (readonly)

Returns The sticker ID.

Returns:



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

def id
  @id
end

#name -> String (readonly)

Returns The sticker name.

Returns:

  • (String)

    The sticker name.



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

def name
  @name
end

Instance Method Details

#inspect -> Object



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

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