Class: Whatsapp::Webhook::Message::Text
- Defined in:
- lib/ruby/whatsapp/webhook/message/text.rb
Overview
An inbound plain-text message.
Instance Attribute Summary collapse
Attributes inherited from Base
#context, #from, #id, #referral, #timestamp, #type
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(body:, **base_attributes) ⇒ Text
constructor
A new instance of Text.
Methods inherited from Base
Constructor Details
#initialize(body:, **base_attributes) ⇒ Text
Returns a new instance of Text.
12 13 14 15 16 |
# File 'lib/ruby/whatsapp/webhook/message/text.rb', line 12 def initialize(body:, **base_attributes) super(**base_attributes) @body = body end |
Instance Attribute Details
#body ⇒ String?
10 11 12 |
# File 'lib/ruby/whatsapp/webhook/message/text.rb', line 10 def body @body end |
Class Method Details
.deserialize(data) ⇒ Text
21 22 23 |
# File 'lib/ruby/whatsapp/webhook/message/text.rb', line 21 def deserialize(data) new(body: data.dig("text", "body"), **common_attributes(data)) end |