Exception: ISO::IBAN::Invalid

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/iso/iban/invalid.rb

Overview

Raised by ISO::IBAN::parse!

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Invalid) initialize(iban)

Returns a new instance of Invalid

Parameters:



18
19
20
21
22
# File 'lib/iso/iban/invalid.rb', line 18

def initialize(iban)
  @iban   = iban
  @errors = iban.validate
  super("The IBAN #{@iban.formatted} is invalid (#{@errors.join(', ')})")
end

Instance Attribute Details

- (Array<Symbol>) errors (readonly)

Returns The errors in the IBAN.

Returns:

  • (Array<Symbol>)

    The errors in the IBAN.

See Also:



11
12
13
# File 'lib/iso/iban/invalid.rb', line 11

def errors
  @errors
end

- (ISO::IBAN) iban (readonly)

Returns The faulty IBAN.

Returns:



14
15
16
# File 'lib/iso/iban/invalid.rb', line 14

def iban
  @iban
end