Class: MijDiscord::Data::Reaction
- Defined in:
- lib/mij-discord/data/emoji.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#me ⇒ Object
(also: #me?)
readonly
Returns the value of attribute me.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Attributes inherited from Emoji
#animated, #name, #roles, #server
Attributes included from IDObject
Instance Method Summary collapse
-
#initialize(data, message) ⇒ Reaction
constructor
A new instance of Reaction.
- #inspect ⇒ Object
- #update_data(count: nil, me: nil) ⇒ Object
Methods inherited from Emoji
#icon_url, #mention, #reaction
Methods included from IDObject
#==, #creation_time, #hash, synthesize, timestamp
Constructor Details
#initialize(data, message) ⇒ Reaction
Returns a new instance of Reaction.
57 58 59 60 61 62 63 64 |
# File 'lib/mij-discord/data/emoji.rb', line 57 def initialize(data, ) super(data['emoji'], nil) @message = @me = !!data['me'] @count = data['count'] || 1 end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
52 53 54 |
# File 'lib/mij-discord/data/emoji.rb', line 52 def count @count end |
#me ⇒ Object (readonly) Also known as: me?
Returns the value of attribute me.
54 55 56 |
# File 'lib/mij-discord/data/emoji.rb', line 54 def me @me end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
50 51 52 |
# File 'lib/mij-discord/data/emoji.rb', line 50 def @message end |
Instance Method Details
#inspect ⇒ Object
71 72 73 |
# File 'lib/mij-discord/data/emoji.rb', line 71 def inspect MijDiscord.make_inspect(self, :id, :name, :count, :me) end |
#update_data(count: nil, me: nil) ⇒ Object
66 67 68 69 |
# File 'lib/mij-discord/data/emoji.rb', line 66 def update_data(count: nil, me: nil) @count = count unless count.nil? @me = me unless me.nil? end |