Class: CritsendEvents::WebhookReceiver
- Inherits:
-
Object
- Object
- CritsendEvents::WebhookReceiver
- Defined in:
- lib/critsend_events/webhook_receiver.rb
Instance Attribute Summary collapse
-
#processor ⇒ Object
readonly
Returns the value of attribute processor.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, handler) ⇒ WebhookReceiver
constructor
A new instance of WebhookReceiver.
Constructor Details
#initialize(app, handler) ⇒ WebhookReceiver
Returns a new instance of WebhookReceiver.
8 9 10 11 |
# File 'lib/critsend_events/webhook_receiver.rb', line 8 def initialize(app, handler) @app = app @processor = WebhookProcessor.new(handler) end |
Instance Attribute Details
#processor ⇒ Object (readonly)
Returns the value of attribute processor.
6 7 8 |
# File 'lib/critsend_events/webhook_receiver.rb', line 6 def processor @processor end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/critsend_events/webhook_receiver.rb', line 13 def call(env) if events_posted?(env) receive_events(env) else @app.call(env) end end |