Class: Arafa::Whatsapp::MessageBody::Interactive::List
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Arafa::Whatsapp::MessageBody::Interactive::List
- Defined in:
- lib/arafa/whatsapp/message_body.rb
Overview
Interactive list WhatsApp message body:
{action: {button, sections}, body: {text}, header: {text}, footer: {text}}.
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
113 114 115 116 117 118 |
# File 'lib/arafa/whatsapp/message_body.rb', line 113 def to_h body = { action: { button: , sections: sections.map(&:to_h) }, body: { text: body_text } } body[:header] = { text: header_text } unless header_text.nil? body[:footer] = { text: } unless .nil? body end |