Class: Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldValidators

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#boleto_bancario_requirednessObject



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

def boleto_bancario_requiredness
  @boleto_bancario_requiredness
end

#email_addressObject



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

def email_address
  @email_address
end

#expiration_dateObject



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

def expiration_date
  @expiration_date
end

#fixed_listObject



29
30
31
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 29

def fixed_list
  @fixed_list
end

#ibanObject



32
33
34
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 32

def iban
  @iban
end

#lengthObject



35
36
37
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 35

def length
  @length
end

#luhnObject



38
39
40
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 38

def luhn
  @luhn
end

#rangeObject



41
42
43
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 41

def range
  @range
end

#regular_expressionObject



44
45
46
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 44

def regular_expression
  @regular_expression
end

#terms_and_conditionsObject



47
48
49
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 47

def terms_and_conditions
  @terms_and_conditions
end

Instance Method Details

#from_hash(hash) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 64

def from_hash(hash)
  super
  if hash.has_key?('boletoBancarioRequiredness')
    if !(hash['boletoBancarioRequiredness'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['boletoBancarioRequiredness']]
    end
    @boleto_bancario_requiredness = Ingenico::Connect::SDK::Domain::Product::BoletoBancarioRequirednessValidator.new_from_hash(hash['boletoBancarioRequiredness'])
  end
  if hash.has_key?('emailAddress')
    if !(hash['emailAddress'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['emailAddress']]
    end
    @email_address = Ingenico::Connect::SDK::Domain::Product::EmptyValidator.new_from_hash(hash['emailAddress'])
  end
  if hash.has_key?('expirationDate')
    if !(hash['expirationDate'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['expirationDate']]
    end
    @expiration_date = Ingenico::Connect::SDK::Domain::Product::EmptyValidator.new_from_hash(hash['expirationDate'])
  end
  if hash.has_key?('fixedList')
    if !(hash['fixedList'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['fixedList']]
    end
    @fixed_list = Ingenico::Connect::SDK::Domain::Product::FixedListValidator.new_from_hash(hash['fixedList'])
  end
  if hash.has_key?('iban')
    if !(hash['iban'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['iban']]
    end
    @iban = Ingenico::Connect::SDK::Domain::Product::EmptyValidator.new_from_hash(hash['iban'])
  end
  if hash.has_key?('length')
    if !(hash['length'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['length']]
    end
    @length = Ingenico::Connect::SDK::Domain::Product::LengthValidator.new_from_hash(hash['length'])
  end
  if hash.has_key?('luhn')
    if !(hash['luhn'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['luhn']]
    end
    @luhn = Ingenico::Connect::SDK::Domain::Product::EmptyValidator.new_from_hash(hash['luhn'])
  end
  if hash.has_key?('range')
    if !(hash['range'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['range']]
    end
    @range = Ingenico::Connect::SDK::Domain::Product::RangeValidator.new_from_hash(hash['range'])
  end
  if hash.has_key?('regularExpression')
    if !(hash['regularExpression'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['regularExpression']]
    end
    @regular_expression = Ingenico::Connect::SDK::Domain::Product::RegularExpressionValidator.new_from_hash(hash['regularExpression'])
  end
  if hash.has_key?('termsAndConditions')
    if !(hash['termsAndConditions'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['termsAndConditions']]
    end
    @terms_and_conditions = Ingenico::Connect::SDK::Domain::Product::EmptyValidator.new_from_hash(hash['termsAndConditions'])
  end
end

#to_hObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field_validators.rb', line 49

def to_h
  hash = super
  add_to_hash(hash, 'boletoBancarioRequiredness', @boleto_bancario_requiredness)
  add_to_hash(hash, 'emailAddress', @email_address)
  add_to_hash(hash, 'expirationDate', @expiration_date)
  add_to_hash(hash, 'fixedList', @fixed_list)
  add_to_hash(hash, 'iban', @iban)
  add_to_hash(hash, 'length', @length)
  add_to_hash(hash, 'luhn', @luhn)
  add_to_hash(hash, 'range', @range)
  add_to_hash(hash, 'regularExpression', @regular_expression)
  add_to_hash(hash, 'termsAndConditions', @terms_and_conditions)
  hash
end