Class: WebPay::ChargeIdRequest

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

Returns a new instance of ChargeIdRequest.



454
455
456
457
# File 'lib/webpay/data_types.rb', line 454

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



435
436
437
# File 'lib/webpay/data_types.rb', line 435

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



442
443
444
445
446
447
448
449
450
451
452
# File 'lib/webpay/data_types.rb', line 442

def self.create(params)
  return params if params.is_a?(self)
  hash = case params
    when Hash; params
    when WebPay::ChargeResponse; {'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



437
438
439
# File 'lib/webpay/data_types.rb', line 437

def self.fields
  ['id']
end

Instance Method Details

#idObject

attributes accessors



472
473
474
# File 'lib/webpay/data_types.rb', line 472

def id
  attributes['id']
end

#id=(value) ⇒ Object



476
477
478
# File 'lib/webpay/data_types.rb', line 476

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

#query_paramsObject



465
466
467
468
# File 'lib/webpay/data_types.rb', line 465

def query_params
  result = {}
  return result
end

#request_bodyObject



460
461
462
463
# File 'lib/webpay/data_types.rb', line 460

def request_body
  result = {}
  result
end