Class: OnlinePayments::SDK::Domain::PaymentProductFieldValidators

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/payment_product_field_validators.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#email_addressOnlinePayments::SDK::Domain::EmptyValidator

Returns the current value of email_address.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def email_address
  @email_address
end

#expiration_dateOnlinePayments::SDK::Domain::EmptyValidator

Returns the current value of expiration_date.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def expiration_date
  @expiration_date
end

#fixed_listOnlinePayments::SDK::Domain::FixedListValidator

Returns the current value of fixed_list.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def fixed_list
  @fixed_list
end

#ibanOnlinePayments::SDK::Domain::EmptyValidator

Returns the current value of iban.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def iban
  @iban
end

#lengthOnlinePayments::SDK::Domain::LengthValidator

Returns the current value of length.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def length
  @length
end

#luhnOnlinePayments::SDK::Domain::EmptyValidator

Returns the current value of luhn.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def luhn
  @luhn
end

#rangeOnlinePayments::SDK::Domain::RangeValidator

Returns the current value of range.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def range
  @range
end

#regular_expressionOnlinePayments::SDK::Domain::RegularExpressionValidator

Returns the current value of regular_expression.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def regular_expression
  @regular_expression
end

#terms_and_conditionsOnlinePayments::SDK::Domain::EmptyValidator

Returns the current value of terms_and_conditions.

Returns:



23
24
25
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 23

def terms_and_conditions
  @terms_and_conditions
end

Instance Method Details

#from_hash(hash) ⇒ Object



49
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
# File 'lib/onlinepayments/sdk/domain/payment_product_field_validators.rb', line 49

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 = OnlinePayments::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 = OnlinePayments::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 = OnlinePayments::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 = OnlinePayments::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 = OnlinePayments::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 = OnlinePayments::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 = OnlinePayments::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 = OnlinePayments::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 = OnlinePayments::SDK::Domain::EmptyValidator.new_from_hash(hash['termsAndConditions'])
  end
end

#to_hHash

Returns:

  • (Hash)


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

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