Class: BabySMS::Adapters::NexmoAdapter::WebHook

Inherits:
WebHook
  • Object
show all
Defined in:
lib/babysms/adapters/nexmo_adapter.rb

Instance Attribute Summary

Attributes inherited from WebHook

#adapter

Instance Method Summary collapse

Methods inherited from WebHook

#end_point, #initialize, #mount_point

Constructor Details

This class inherits a constructor from BabySMS::WebHook

Instance Method Details

#process(app:, report:) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/babysms/adapters/nexmo_adapter.rb', line 28

def process(app:, report:)
  message = BabySMS::Message.new(from: app.params['msisdn'],
                                 to: app.params['to'],
                                 contents: app.params['text'],
                                 uuid: app.params['messageId'])
  report.incoming_message(message)
  [200, { 'Content-Type' => 'text/plain' }, 'ok']
end