Class: BabySMS::WebHook
- Inherits:
-
Object
- Object
- BabySMS::WebHook
- Defined in:
- lib/babysms/web_hook.rb
Direct Known Subclasses
Adapters::BandwidthAdapter::WebHook, Adapters::NexmoAdapter::WebHook, Adapters::PlivoAdapter::WebHook, Adapters::SignalwireAdapter::WebHook, Adapters::TestAdapter::WebHook, Adapters::TwilioAdapter::WebHook
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
Instance Method Summary collapse
-
#end_point ⇒ Object
This is the public URL of the webhook.
-
#initialize(adapter) ⇒ WebHook
constructor
A new instance of WebHook.
-
#mount_point ⇒ Object
This is where the webhook handler is mounted relative to the Rack application.
Constructor Details
#initialize(adapter) ⇒ WebHook
Returns a new instance of WebHook.
5 6 7 |
# File 'lib/babysms/web_hook.rb', line 5 def initialize(adapter) @adapter = adapter end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
3 4 5 |
# File 'lib/babysms/web_hook.rb', line 3 def adapter @adapter end |
Instance Method Details
#end_point ⇒ Object
This is the public URL of the webhook
15 16 17 18 19 |
# File 'lib/babysms/web_hook.rb', line 15 def end_point # Remove optional trailing '/' in configuration root = BabySMS.web_hook_root.gsub(/\/\z/, '') root + mount_point end |
#mount_point ⇒ Object
This is where the webhook handler is mounted relative to the Rack application
10 11 12 |
# File 'lib/babysms/web_hook.rb', line 10 def mount_point "/#{adapter.adapter_id}" end |