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.



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

def initialize(payload)
  @payload = payload
end

Instance Attribute Details

#payloadObject (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_classObject



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

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

#resource_objectObject



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

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