Class: BridgeCache::Webhooks::Request

Inherits:
Object
  • Object
show all
Defined in:
app/lib/bridge_cache/webhooks/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Request

Returns a new instance of Request.



4
5
6
# File 'app/lib/bridge_cache/webhooks/request.rb', line 4

def initialize(payload)
  @payload = payload
end

Instance Method Details

#processObject



8
9
10
11
# File 'app/lib/bridge_cache/webhooks/request.rb', line 8

def process
  message = BridgeCache::Webhooks::Message.new(@payload)
  message.payload_class.public_send("webhook_#{@payload['trigger']}".to_sym, message)
end