Class: MijDiscord::Data::Reaction
- Inherits:
-
Object
- Object
- MijDiscord::Data::Reaction
- Defined in:
- lib/mij-discord/data/emoji.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#me ⇒ Object
(also: #me?)
readonly
Returns the value of attribute me.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(data) ⇒ Reaction
constructor
A new instance of Reaction.
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
#count ⇒ Object (readonly)
Returns the value of attribute count.
45 46 47 |
# File 'lib/mij-discord/data/emoji.rb', line 45 def count @count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
41 42 43 |
# File 'lib/mij-discord/data/emoji.rb', line 41 def id @id end |
#me ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
43 44 45 |
# File 'lib/mij-discord/data/emoji.rb', line 43 def name @name end |