Class: Ingenico::Connect::SDK::Domain::Services::GetIINDetailsResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#co_brandsObject

Array of IINDetail



15
16
17
# File 'lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb', line 15

def co_brands
  @co_brands
end

#country_codeObject

String



18
19
20
# File 'lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb', line 18

def country_code
  @country_code
end

#is_allowed_in_contextObject

true/false



21
22
23
# File 'lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb', line 21

def is_allowed_in_context
  @is_allowed_in_context
end

#payment_product_idObject

Integer



24
25
26
# File 'lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb', line 24

def payment_product_id
  @payment_product_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb', line 35

def from_hash(hash)
  super
  if hash.has_key?('coBrands')
    if !(hash['coBrands'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['coBrands']]
    end
    @co_brands = []
    hash['coBrands'].each do |e|
      @co_brands << Ingenico::Connect::SDK::Domain::Services::IINDetail.new_from_hash(e)
    end
  end
  if hash.has_key?('countryCode')
    @country_code = hash['countryCode']
  end
  if hash.has_key?('isAllowedInContext')
    @is_allowed_in_context = hash['isAllowedInContext']
  end
  if hash.has_key?('paymentProductId')
    @payment_product_id = hash['paymentProductId']
  end
end

#to_hObject



26
27
28
29
30
31
32
33
# File 'lib/ingenico/connect/sdk/domain/services/get_iin_details_response.rb', line 26

def to_h
  hash = super
  add_to_hash(hash, 'coBrands', @co_brands)
  add_to_hash(hash, 'countryCode', @country_code)
  add_to_hash(hash, 'isAllowedInContext', @is_allowed_in_context)
  add_to_hash(hash, 'paymentProductId', @payment_product_id)
  hash
end