Class: ChatSDK::Events::Reaction

Inherits:
Base
  • Object
show all
Defined in:
lib/chat_sdk/events/reaction.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#adapter_name, #platform, #raw, #timestamp, #type

Instance Method Summary collapse

Constructor Details

#initialize(emoji:, user_id:, message_id:, thread_id:, channel_id:, added: true, **kwargs) ⇒ Reaction

Returns a new instance of Reaction.



9
10
11
12
13
14
15
16
17
# File 'lib/chat_sdk/events/reaction.rb', line 9

def initialize(emoji:, user_id:, message_id:, thread_id:, channel_id:, added: true, **kwargs)
  super(type: :reaction, **kwargs)
  @emoji = emoji
  @user_id = user_id
  @message_id = message_id
  @thread_id = thread_id
  @channel_id = channel_id
  @added = added
end

Instance Attribute Details

#addedObject (readonly)

Returns the value of attribute added.



6
7
8
# File 'lib/chat_sdk/events/reaction.rb', line 6

def added
  @added
end

#channel_idObject (readonly)

Returns the value of attribute channel_id.



6
7
8
# File 'lib/chat_sdk/events/reaction.rb', line 6

def channel_id
  @channel_id
end

#emojiObject (readonly)

Returns the value of attribute emoji.



6
7
8
# File 'lib/chat_sdk/events/reaction.rb', line 6

def emoji
  @emoji
end

#message_idObject (readonly)

Returns the value of attribute message_id.



6
7
8
# File 'lib/chat_sdk/events/reaction.rb', line 6

def message_id
  @message_id
end

#threadObject

Returns the value of attribute thread.



7
8
9
# File 'lib/chat_sdk/events/reaction.rb', line 7

def thread
  @thread
end

#thread_idObject (readonly)

Returns the value of attribute thread_id.



6
7
8
# File 'lib/chat_sdk/events/reaction.rb', line 6

def thread_id
  @thread_id
end

#user_idObject (readonly)

Returns the value of attribute user_id.



6
7
8
# File 'lib/chat_sdk/events/reaction.rb', line 6

def user_id
  @user_id
end

Instance Method Details

#added?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/chat_sdk/events/reaction.rb', line 19

def added?
  @added
end

#removed?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/chat_sdk/events/reaction.rb', line 23

def removed?
  !@added
end