Class: Arafa::Whatsapp::MessageBody::Interactive::Section

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/arafa/whatsapp/message_body.rb

Overview

One section of an interactive list: {title, rows, product_items}.

Instance Method Summary collapse

Instance Method Details

#to_hObject



83
84
85
86
87
# File 'lib/arafa/whatsapp/message_body.rb', line 83

def to_h
  body = { title: title, rows: rows.map(&:to_h) }
  body[:product_items] = product_items unless product_items.nil?
  body
end