Class: Adcloud::WebhookEvent
- Inherits:
-
Object
- Object
- Adcloud::WebhookEvent
- Defined in:
- lib/adcloud/webhook_event.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Method Summary collapse
-
#initialize(raw_response) ⇒ WebhookEvent
constructor
A new instance of WebhookEvent.
- #test_data? ⇒ Boolean
- #type ⇒ Object
Constructor Details
#initialize(raw_response) ⇒ WebhookEvent
Returns a new instance of WebhookEvent.
5 6 7 8 |
# File 'lib/adcloud/webhook_event.rb', line 5 def initialize(raw_response) @meta = raw_response.delete('_meta') || {} @data = raw_response || {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/adcloud/webhook_event.rb', line 3 def data @data end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
3 4 5 |
# File 'lib/adcloud/webhook_event.rb', line 3 def @meta end |
Instance Method Details
#test_data? ⇒ Boolean
14 15 16 |
# File 'lib/adcloud/webhook_event.rb', line 14 def test_data? @meta.has_key?('is_test_data') && @meta['is_test_data'] end |
#type ⇒ Object
10 11 12 |
# File 'lib/adcloud/webhook_event.rb', line 10 def type @meta['event'] end |