Class: Ingenico::Connect::SDK::Domain::Riskassessments::CustomerRiskAssessment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#billing_addressObject



17
18
19
# File 'lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb', line 17

def billing_address
  @billing_address
end

#localeObject

String



20
21
22
# File 'lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb', line 20

def locale
  @locale
end

#personal_informationObject



23
24
25
# File 'lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb', line 23

def personal_information
  @personal_information
end

#shipping_addressObject



26
27
28
# File 'lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb', line 26

def shipping_address
  @shipping_address
end

Instance Method Details

#from_hash(hash) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb', line 37

def from_hash(hash)
  super
  if hash.has_key?('billingAddress')
    if !(hash['billingAddress'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['billingAddress']]
    end
    @billing_address = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['billingAddress'])
  end
  if hash.has_key?('locale')
    @locale = hash['locale']
  end
  if hash.has_key?('personalInformation')
    if !(hash['personalInformation'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']]
    end
    @personal_information = Ingenico::Connect::SDK::Domain::Riskassessments::PersonalInformationRiskAssessment.new_from_hash(hash['personalInformation'])
  end
  if hash.has_key?('shippingAddress')
    if !(hash['shippingAddress'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['shippingAddress']]
    end
    @shipping_address = Ingenico::Connect::SDK::Domain::Payment::AddressPersonal.new_from_hash(hash['shippingAddress'])
  end
end

#to_hObject



28
29
30
31
32
33
34
35
# File 'lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb', line 28

def to_h
  hash = super
  add_to_hash(hash, 'billingAddress', @billing_address)
  add_to_hash(hash, 'locale', @locale)
  add_to_hash(hash, 'personalInformation', @personal_information)
  add_to_hash(hash, 'shippingAddress', @shipping_address)
  hash
end