Class: WebPay::CustomerIdRequest

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

Returns a new instance of CustomerIdRequest.



1027
1028
1029
1030
# File 'lib/webpay/data_types.rb', line 1027

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1008
1009
1010
# File 'lib/webpay/data_types.rb', line 1008

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/webpay/data_types.rb', line 1015

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



1010
1011
1012
# File 'lib/webpay/data_types.rb', line 1010

def self.fields
  ['id']
end

Instance Method Details

#idObject

attributes accessors



1045
1046
1047
# File 'lib/webpay/data_types.rb', line 1045

def id
  attributes['id']
end

#id=(value) ⇒ Object



1049
1050
1051
# File 'lib/webpay/data_types.rb', line 1049

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

#query_paramsObject



1038
1039
1040
1041
# File 'lib/webpay/data_types.rb', line 1038

def query_params
  result = {}
  return result
end

#request_bodyObject



1033
1034
1035
1036
# File 'lib/webpay/data_types.rb', line 1033

def request_body
  result = {}
  result
end