Class: WebPay::TokenIdRequest

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

Returns a new instance of TokenIdRequest.



1359
1360
1361
1362
# File 'lib/webpay/data_types.rb', line 1359

def initialize(hash = {})
  hash = normalize_hash(hash)
  @attributes = hash
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
# File 'lib/webpay/data_types.rb', line 1347

def self.create(params)
  return params if params.is_a?(self)
  hash = case params
    when Hash; params
    when WebPay::TokenResponse; {'id' => params.id}
    when String; {'id' => params}
    else
      raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
    end
  self.new(hash)
end

.fieldsObject



1342
1343
1344
# File 'lib/webpay/data_types.rb', line 1342

def self.fields
  ['id']
end

Instance Method Details

#idObject

attributes accessors



1377
1378
1379
# File 'lib/webpay/data_types.rb', line 1377

def id
  attributes['id']
end

#id=(value) ⇒ Object



1381
1382
1383
# File 'lib/webpay/data_types.rb', line 1381

def id=(value)
  attributes['id'] = value
end

#query_paramsObject



1370
1371
1372
1373
# File 'lib/webpay/data_types.rb', line 1370

def query_params
  result = {}
  return result
end

#request_bodyObject



1365
1366
1367
1368
# File 'lib/webpay/data_types.rb', line 1365

def request_body
  result = {}
  result
end