Class: Adcloud::WebhookEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/adcloud/webhook_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/adcloud/webhook_event.rb', line 3

def data
  @data
end

#metaObject (readonly)

Returns the value of attribute meta.



3
4
5
# File 'lib/adcloud/webhook_event.rb', line 3

def meta
  @meta
end

Instance Method Details

#test_data?Boolean

Returns:

  • (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

#typeObject



10
11
12
# File 'lib/adcloud/webhook_event.rb', line 10

def type
  @meta['event']
end