Class: BabySMS::Adapters::PlivoAdapter::WebHook

Inherits:
WebHook
  • Object
show all
Defined in:
lib/babysms/adapters/plivo_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



22
23
24
25
26
27
28
29
30
# File 'lib/babysms/adapters/plivo_adapter.rb', line 22

def process(app:, report:)
  # 'Uuid' is the uuid.  Also of note: NumMedia, and MediaContentType0, MediaUrl0
  message = BabySMS::Message.new(from: app.params['From'],
                                 to: app.params['To'],
                                 contents: app.params['Text'],
                                 uuid: app.params['Uuid'])
  report.incoming_message(message)
  [200, { 'Content-Type' => 'text/plain' }, 'ok']
end