Class: BabySMS::Adapters::TestAdapter::WebHook
- Defined in:
- lib/babysms/adapters/test_adapter.rb
Instance Attribute Summary
Attributes inherited from WebHook
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
49 50 51 52 53 54 55 56 57 |
# File 'lib/babysms/adapters/test_adapter.rb', line 49 def process(app:, report:) json = JSON.parse(app.request.body.read) = BabySMS::Message.new(to: adapter.from, from: json["from"], contents: json["body"]) report.() [200, { "Content-Type" => "text/plain" }, 'ok'] end |