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.



1459
1460
1461
1462
1463
# File 'lib/webpay/data_types.rb', line 1459

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.



1452
1453
1454
# File 'lib/webpay/data_types.rb', line 1452

def attributes
  @attributes
end

Class Method Details

.fieldsObject



1454
1455
1456
# File 'lib/webpay/data_types.rb', line 1454

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

Instance Method Details

#createdObject



1480
1481
1482
# File 'lib/webpay/data_types.rb', line 1480

def created
  attributes['created']
end

#dataObject



1484
1485
1486
# File 'lib/webpay/data_types.rb', line 1484

def data
  attributes['data']
end

#idObject

attributes accessors



1468
1469
1470
# File 'lib/webpay/data_types.rb', line 1468

def id
  attributes['id']
end

#livemodeObject



1476
1477
1478
# File 'lib/webpay/data_types.rb', line 1476

def livemode
  attributes['livemode']
end

#objectObject



1472
1473
1474
# File 'lib/webpay/data_types.rb', line 1472

def object
  attributes['object']
end

#pending_webhooksObject



1488
1489
1490
# File 'lib/webpay/data_types.rb', line 1488

def pending_webhooks
  attributes['pending_webhooks']
end

#shopObject



1496
1497
1498
# File 'lib/webpay/data_types.rb', line 1496

def shop
  attributes['shop']
end

#typeObject



1492
1493
1494
# File 'lib/webpay/data_types.rb', line 1492

def type
  attributes['type']
end