Class: WebPay::EventResponse

Inherits:
Entity
  • Object
show all
Defined in:
lib/webpay/data_types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#normalize_hash, #to_h, #to_s

Constructor Details

#initialize(hash = {}) ⇒ EventResponse

Returns a new instance of EventResponse.



1410
1411
1412
1413
1414
# File 'lib/webpay/data_types.rb', line 1410

def initialize(hash = {})
  hash = normalize_hash(hash)
  hash['data'] = WebPay::EventData.new(hash['data']) if hash['data'].is_a?(Hash)
  @attributes = hash
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1403
1404
1405
# File 'lib/webpay/data_types.rb', line 1403

def attributes
  @attributes
end

Class Method Details

.fieldsObject



1405
1406
1407
# File 'lib/webpay/data_types.rb', line 1405

def self.fields
  ['id', 'object', 'livemode', 'created', 'data', 'pending_webhooks', 'type', 'shop']
end

Instance Method Details

#createdObject



1431
1432
1433
# File 'lib/webpay/data_types.rb', line 1431

def created
  attributes['created']
end

#dataObject



1435
1436
1437
# File 'lib/webpay/data_types.rb', line 1435

def data
  attributes['data']
end

#idObject

attributes accessors



1419
1420
1421
# File 'lib/webpay/data_types.rb', line 1419

def id
  attributes['id']
end

#livemodeObject



1427
1428
1429
# File 'lib/webpay/data_types.rb', line 1427

def livemode
  attributes['livemode']
end

#objectObject



1423
1424
1425
# File 'lib/webpay/data_types.rb', line 1423

def object
  attributes['object']
end

#pending_webhooksObject



1439
1440
1441
# File 'lib/webpay/data_types.rb', line 1439

def pending_webhooks
  attributes['pending_webhooks']
end

#shopObject



1447
1448
1449
# File 'lib/webpay/data_types.rb', line 1447

def shop
  attributes['shop']
end

#typeObject



1443
1444
1445
# File 'lib/webpay/data_types.rb', line 1443

def type
  attributes['type']
end