Class: Ibancom::Resources::IBAN::Check

Inherits:
Base
  • Object
show all
Defined in:
lib/ibancom/resources/iban/check.rb

Constant Summary collapse

PASSED_MESSAGES =
{
  "001" => "IBAN Check digit is correct",
  "002" => "Account Number check digit is correct",
  "003" => "IBAN Length is correct",
  "004" => "Account Number check digit is not performed for this bank or branch",
  "005" => "IBAN structure is correct",
  "006" => "IBAN does not contain illegal characters",
  "007" => "Country supports IBAN standard",
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#initialize, map

Constructor Details

This class inherits a constructor from Ibancom::Resources::Base

Instance Attribute Details

#codeObject

Returns the value of attribute code.



17
18
19
# File 'lib/ibancom/resources/iban/check.rb', line 17

def code
  @code
end

#messageObject

Returns the value of attribute message.



17
18
19
# File 'lib/ibancom/resources/iban/check.rb', line 17

def message
  @message
end

#typeObject

Returns the value of attribute type.



17
18
19
# File 'lib/ibancom/resources/iban/check.rb', line 17

def type
  @type
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ibancom/resources/iban/check.rb', line 25

def failed?
  !passed?
end

#passed?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ibancom/resources/iban/check.rb', line 21

def passed?
  PASSED_MESSAGES[code] == message
end