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.



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

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.



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

def format
  @format
end

#id -> Discorb::Snowflake (readonly)

Returns The sticker ID.

Returns:



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

def id
  @id
end

#name -> String (readonly)

Returns The sticker name.

Returns:

  • (String)

    The sticker name.



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

def name
  @name
end

Instance Method Details

#inspect -> Object



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

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