Class: Arafa::Whatsapp::MessageBody::Interactive::Buttons
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Arafa::Whatsapp::MessageBody::Interactive::Buttons
- Defined in:
- lib/arafa/whatsapp/message_body.rb
Overview
Interactive buttons WhatsApp message body:
{action: {buttons}, body: {text}, header: {text}}.
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
97 98 99 100 101 |
# File 'lib/arafa/whatsapp/message_body.rb', line 97 def to_h body = { action: { buttons: .map(&:to_h) }, body: { text: body_text } } body[:header] = { text: header_text } unless header_text.nil? body end |