Class: BridgeCache::Webhooks::Message
- Inherits:
-
Object
- Object
- BridgeCache::Webhooks::Message
- Defined in:
- app/lib/bridge_cache/webhooks/message.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Message
constructor
A new instance of Message.
- #payload_class ⇒ Object
- #resource_object ⇒ Object
Constructor Details
#initialize(payload) ⇒ Message
Returns a new instance of Message.
6 7 8 |
# File 'app/lib/bridge_cache/webhooks/message.rb', line 6 def initialize(payload) @payload = payload end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
4 5 6 |
# File 'app/lib/bridge_cache/webhooks/message.rb', line 4 def payload @payload end |
Instance Method Details
#payload_class ⇒ Object
14 15 16 |
# File 'app/lib/bridge_cache/webhooks/message.rb', line 14 def payload_class "BridgeCache::#{@payload['resource'].camelcase}".constantize end |
#resource_object ⇒ Object
10 11 12 |
# File 'app/lib/bridge_cache/webhooks/message.rb', line 10 def resource_object @payload[@payload['resource']] end |