Class: Ingenico::Direct::SDK::Domain::PaymentProductFieldValidators

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#email_addressIngenico::Direct::SDK::Domain::EmptyValidator

Returns the current value of email_address.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def email_address
  @email_address
end

#expiration_dateIngenico::Direct::SDK::Domain::EmptyValidator

Returns the current value of expiration_date.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def expiration_date
  @expiration_date
end

#fixed_listIngenico::Direct::SDK::Domain::FixedListValidator

Returns the current value of fixed_list.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def fixed_list
  @fixed_list
end

#ibanIngenico::Direct::SDK::Domain::EmptyValidator

Returns the current value of iban.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def iban
  @iban
end

#lengthIngenico::Direct::SDK::Domain::LengthValidator

Returns the current value of length.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def length
  @length
end

#luhnIngenico::Direct::SDK::Domain::EmptyValidator

Returns the current value of luhn.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def luhn
  @luhn
end

#rangeIngenico::Direct::SDK::Domain::RangeValidator

Returns the current value of range.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def range
  @range
end

#regular_expressionIngenico::Direct::SDK::Domain::RegularExpressionValidator

Returns the current value of regular_expression.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def regular_expression
  @regular_expression
end

#terms_and_conditionsIngenico::Direct::SDK::Domain::EmptyValidator

Returns the current value of terms_and_conditions.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 24

def terms_and_conditions
  @terms_and_conditions
end

Instance Method Details

#from_hash(hash) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 50

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

#to_hHash

Returns:

  • (Hash)


36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_validators.rb', line 36

def to_h
  hash = super
  hash['emailAddress'] = @email_address.to_h if @email_address
  hash['expirationDate'] = @expiration_date.to_h if @expiration_date
  hash['fixedList'] = @fixed_list.to_h if @fixed_list
  hash['iban'] = @iban.to_h if @iban
  hash['length'] = @length.to_h if @length
  hash['luhn'] = @luhn.to_h if @luhn
  hash['range'] = @range.to_h if @range
  hash['regularExpression'] = @regular_expression.to_h if @regular_expression
  hash['termsAndConditions'] = @terms_and_conditions.to_h if @terms_and_conditions
  hash
end