Class: Arafa::Whatsapp::MessageBody::Template

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

Overview

Template WhatsApp message body: {templateId, headerValue, bodyValues}.

Instance Method Summary collapse

Instance Method Details

#to_hObject



45
46
47
48
49
# File 'lib/arafa/whatsapp/message_body.rb', line 45

def to_h
  body = { templateId: template_id, bodyValues: body_values }
  body[:headerValue] = header_value unless header_value.nil?
  body
end