Class: CritsendEvents::WebhookReceiver

Inherits:
Object
  • Object
show all
Defined in:
lib/critsend_events/webhook_receiver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#processorObject (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