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.



1323
1324
1325
1326
1327
# File 'lib/webpay/data_types.rb', line 1323

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.



1316
1317
1318
# File 'lib/webpay/data_types.rb', line 1316

def attributes
  @attributes
end

Class Method Details

.fieldsObject



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

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

Instance Method Details

#cardObject



1344
1345
1346
# File 'lib/webpay/data_types.rb', line 1344

def card
  attributes['card']
end

#createdObject



1348
1349
1350
# File 'lib/webpay/data_types.rb', line 1348

def created
  attributes['created']
end

#idObject

attributes accessors



1332
1333
1334
# File 'lib/webpay/data_types.rb', line 1332

def id
  attributes['id']
end

#livemodeObject



1340
1341
1342
# File 'lib/webpay/data_types.rb', line 1340

def livemode
  attributes['livemode']
end

#objectObject



1336
1337
1338
# File 'lib/webpay/data_types.rb', line 1336

def object
  attributes['object']
end

#usedObject



1352
1353
1354
# File 'lib/webpay/data_types.rb', line 1352

def used
  attributes['used']
end