Class: BridgeCache::Webhooks::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Message

Returns a new instance of Message.



5
6
7
# File 'app/lib/bridge_cache/webhooks/message.rb', line 5

def initialize(payload)
  @payload = payload
end

Instance Attribute Details

#payloadObject (readonly)

Returns the value of attribute payload.



3
4
5
# File 'app/lib/bridge_cache/webhooks/message.rb', line 3

def payload
  @payload
end

Instance Method Details

#payload_classObject



13
14
15
# File 'app/lib/bridge_cache/webhooks/message.rb', line 13

def payload_class
  "BridgeCache::#{@payload['resource'].camelcase}".constantize
end

#resource_objectObject



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

def resource_object
  @payload[@payload['resource']]
end