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",
  "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.



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

def code
  @code
end

#messageObject

Returns the value of attribute message.



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

def message
  @message
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


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

def failed?
  !passed?
end

#passed?Boolean

Returns:

  • (Boolean)


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

def passed?
  PASSED_MESSAGES[code] == message
end