Class: WebPay::TokenResponse

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 = {}) ⇒ TokenResponse

Returns a new instance of TokenResponse.



1305
1306
1307
1308
1309
# File 'lib/webpay/data_types.rb', line 1305

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1298
1299
1300
# File 'lib/webpay/data_types.rb', line 1298

def attributes
  @attributes
end

Class Method Details

.fieldsObject



1300
1301
1302
# File 'lib/webpay/data_types.rb', line 1300

def self.fields
  ['id', 'object', 'livemode', 'card', 'created', 'used']
end

Instance Method Details

#cardObject



1326
1327
1328
# File 'lib/webpay/data_types.rb', line 1326

def card
  attributes['card']
end

#createdObject



1330
1331
1332
# File 'lib/webpay/data_types.rb', line 1330

def created
  attributes['created']
end

#idObject

attributes accessors



1314
1315
1316
# File 'lib/webpay/data_types.rb', line 1314

def id
  attributes['id']
end

#livemodeObject



1322
1323
1324
# File 'lib/webpay/data_types.rb', line 1322

def livemode
  attributes['livemode']
end

#objectObject



1318
1319
1320
# File 'lib/webpay/data_types.rb', line 1318

def object
  attributes['object']
end

#usedObject



1334
1335
1336
# File 'lib/webpay/data_types.rb', line 1334

def used
  attributes['used']
end