Class: Whatsapp::Webhook::Message::Reaction
- Defined in:
- lib/ruby/whatsapp/webhook/message/reaction.rb
Overview
An inbound emoji reaction to a previous message.
Instance Attribute Summary collapse
-
#emoji ⇒ String?
Empty when the user removed a previous reaction.
-
#message_id ⇒ String?
The wamid of the message being reacted to.
Attributes inherited from Base
#context, #from, #id, #referral, #timestamp, #type
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message_id:, emoji:, **base_attributes) ⇒ Reaction
constructor
A new instance of Reaction.
Methods inherited from Base
Constructor Details
#initialize(message_id:, emoji:, **base_attributes) ⇒ Reaction
Returns a new instance of Reaction.
16 17 18 19 20 21 |
# File 'lib/ruby/whatsapp/webhook/message/reaction.rb', line 16 def initialize(message_id:, emoji:, **base_attributes) super(**base_attributes) @message_id = @emoji = emoji end |
Instance Attribute Details
#emoji ⇒ String?
Returns Empty when the user removed a previous reaction.
14 15 16 |
# File 'lib/ruby/whatsapp/webhook/message/reaction.rb', line 14 def emoji @emoji end |
#message_id ⇒ String?
Returns The wamid of the message being reacted to.
10 11 12 |
# File 'lib/ruby/whatsapp/webhook/message/reaction.rb', line 10 def @message_id end |
Class Method Details
.deserialize(data) ⇒ Reaction
26 27 28 29 30 31 32 |
# File 'lib/ruby/whatsapp/webhook/message/reaction.rb', line 26 def deserialize(data) new( message_id: data.dig("reaction", "message_id"), emoji: data.dig("reaction", "emoji"), **common_attributes(data) ) end |