Class: MijDiscord::Data::Reaction

Inherits:
Object
  • Object
show all
Defined in:
lib/mij-discord/data/emoji.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Reaction

Returns a new instance of Reaction.



50
51
52
53
54
55
56
# File 'lib/mij-discord/data/emoji.rb', line 50

def initialize(data)
  @me = !!data['me']
  @count = data['count'] || 1

  @id = data['emoji']['id']&.to_i
  @name = data['emoji']['name']
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



45
46
47
# File 'lib/mij-discord/data/emoji.rb', line 45

def count
  @count
end

#idObject (readonly)

Returns the value of attribute id.



41
42
43
# File 'lib/mij-discord/data/emoji.rb', line 41

def id
  @id
end

#meObject (readonly) Also known as: me?

Returns the value of attribute me.



47
48
49
# File 'lib/mij-discord/data/emoji.rb', line 47

def me
  @me
end

#nameObject (readonly)

Returns the value of attribute name.



43
44
45
# File 'lib/mij-discord/data/emoji.rb', line 43

def name
  @name
end