Class: PostcodeAnywhere::BankAccountValidationResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/postcodeanywhere_banking.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(res = {}) ⇒ BankAccountValidationResponse

Returns a new instance of BankAccountValidationResponse.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/postcodeanywhere_banking.rb', line 40

def initialize(res = {})
  res.keys.each do |att|
    instance_variable_set "@#{underscore(att)}".to_sym, res[att]
  end
  @error = res["Error"] ? true : false
  if @error
    @error_code = res["Error"]
    @error_message = "#{@description}: #{@cause} #{@resolution}"
  else
    ["@is_correct", "@is_direct_debit_capable", "@faster_payments_supported", "@chaps_supported"].each do |att|
      instance_variable_set att.to_sym, (instance_variable_get(att) == "True" ? true : false)
    end
  end
end

Instance Attribute Details

#bankObject (readonly)

Returns the value of attribute bank.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def bank
  @bank
end

#bank_bicObject (readonly)

Returns the value of attribute bank_bic.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def bank_bic
  @bank_bic
end

#branchObject (readonly)

Returns the value of attribute branch.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def branch
  @branch
end

#branch_bicObject (readonly)

Returns the value of attribute branch_bic.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def branch_bic
  @branch_bic
end

#causeObject (readonly)

Returns the value of attribute cause.



38
39
40
# File 'lib/postcodeanywhere_banking.rb', line 38

def cause
  @cause
end

#chaps_supportedObject (readonly)

Returns the value of attribute chaps_supported.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def chaps_supported
  @chaps_supported
end

#contact_address_line1Object (readonly)

Returns the value of attribute contact_address_line1.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def contact_address_line1
  @contact_address_line1
end

#contact_address_line2Object (readonly)

Returns the value of attribute contact_address_line2.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def contact_address_line2
  @contact_address_line2
end

#contact_faxObject (readonly)

Returns the value of attribute contact_fax.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def contact_fax
  @contact_fax
end

#contact_phoneObject (readonly)

Returns the value of attribute contact_phone.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def contact_phone
  @contact_phone
end

#contact_post_townObject (readonly)

Returns the value of attribute contact_post_town.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def contact_post_town
  @contact_post_town
end

#contact_postcodeObject (readonly)

Returns the value of attribute contact_postcode.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def contact_postcode
  @contact_postcode
end

#corrected_account_numberObject (readonly)

Returns the value of attribute corrected_account_number.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def 
  @corrected_account_number
end

#corrected_sort_codeObject (readonly)

Returns the value of attribute corrected_sort_code.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def corrected_sort_code
  @corrected_sort_code
end

#descriptionObject (readonly)

Returns the value of attribute description.



38
39
40
# File 'lib/postcodeanywhere_banking.rb', line 38

def description
  @description
end

#errorObject (readonly)

Returns the value of attribute error.



38
39
40
# File 'lib/postcodeanywhere_banking.rb', line 38

def error
  @error
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



38
39
40
# File 'lib/postcodeanywhere_banking.rb', line 38

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



38
39
40
# File 'lib/postcodeanywhere_banking.rb', line 38

def error_message
  @error_message
end

#faster_payments_supportedObject (readonly)

Returns the value of attribute faster_payments_supported.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def faster_payments_supported
  @faster_payments_supported
end

#ibanObject (readonly)

Returns the value of attribute iban.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def iban
  @iban
end

#is_correctObject (readonly)

Returns the value of attribute is_correct.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def is_correct
  @is_correct
end

#is_direct_debit_capableObject (readonly)

Returns the value of attribute is_direct_debit_capable.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def is_direct_debit_capable
  @is_direct_debit_capable
end

#resolutionObject (readonly)

Returns the value of attribute resolution.



38
39
40
# File 'lib/postcodeanywhere_banking.rb', line 38

def resolution
  @resolution
end

#status_informationObject (readonly)

Returns the value of attribute status_information.



35
36
37
# File 'lib/postcodeanywhere_banking.rb', line 35

def status_information
  @status_information
end