Class: MijDiscord::Data::Reaction

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

Instance Attribute Summary collapse

Attributes inherited from Emoji

#animated, #name, #roles, #server

Attributes included from IDObject

#id

Instance Method Summary collapse

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, message)
  super(data['emoji'], nil)

  @message = message

  @me = !!data['me']
  @count = data['count'] || 1
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



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

def count
  @count
end

#meObject (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

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

Instance Method Details

#inspectObject



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