Sha256: e2bf7f3e408493671b00b8b97e40ee120070d4603d0c5e89a71037066b5b1752

Contents?: true

Size: 356 Bytes

Versions: 1

Compression:

Stored size: 356 Bytes

Contents

module BankValidator
  class Bic
    attr_accessor :value

    def initialize(bic)
      @value = bic
    end

    def valid?
      BankValidator::Bic.valid_format?(value) && (value.length == 8 || value.length == 11)
    end

    def self.valid_format?(bic)
      bic =~ /[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}/ ? true : false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bank-validator-0.3.2 lib/bank_validator/bic.rb