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



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

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.



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

def attributes
  @attributes
end

Class Method Details

.fieldsObject



1470
1471
1472
# File 'lib/webpay/data_types.rb', line 1470

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

Instance Method Details

#createdObject



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

def created
  attributes['created']
end

#dataObject



1500
1501
1502
# File 'lib/webpay/data_types.rb', line 1500

def data
  attributes['data']
end

#idObject

attributes accessors



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

def id
  attributes['id']
end

#livemodeObject



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

def livemode
  attributes['livemode']
end

#objectObject



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

def object
  attributes['object']
end

#pending_webhooksObject



1504
1505
1506
# File 'lib/webpay/data_types.rb', line 1504

def pending_webhooks
  attributes['pending_webhooks']
end

#shopObject



1512
1513
1514
# File 'lib/webpay/data_types.rb', line 1512

def shop
  attributes['shop']
end

#typeObject



1508
1509
1510
# File 'lib/webpay/data_types.rb', line 1508

def type
  attributes['type']
end