Class: Ingenico::Connect::SDK::Domain::Product::GetCustomerDetailsRequest

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#country_codeString

Returns the current value of country_code.

Returns:

  • (String)

    the current value of country_code



14
15
16
# File 'lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb', line 14

def country_code
  @country_code
end

#valuesArray<Ingenico::Connect::SDK::Domain::Definitions::KeyValuePair>

Returns the current value of values.

Returns:



14
15
16
# File 'lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb', line 14

def values
  @values
end

Instance Method Details

#from_hash(hash) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb', line 28

def from_hash(hash)
  super
  if hash.has_key? 'countryCode'
    @country_code = hash['countryCode']
  end
  if hash.has_key? 'values'
    raise TypeError, "value '%s' is not an Array" % [hash['values']] unless hash['values'].is_a? Array
    @values = []
    hash['values'].each do |e|
      @values << Ingenico::Connect::SDK::Domain::Definitions::KeyValuePair.new_from_hash(e)
    end
  end
end

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
# File 'lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb', line 21

def to_h
  hash = super
  hash['countryCode'] = @country_code unless @country_code.nil?
  hash['values'] = @values.collect{|val| val.to_h} unless @values.nil?
  hash
end