Sha256: 8618cc4ec17e72e48894eda8e7f289c4def2506b601d65caf83333fcd4ab336e

Contents?: true

Size: 376 Bytes

Versions: 1

Compression:

Stored size: 376 Bytes

Contents

module MagickNumbers
  class Regon 

    def initialize(num)
      @factory = if(/^\d{9}$/ =~ num)
                    Regon9.new num
                 elsif(/^\d{14}$/ =~ num)
                    Regon14.new num
                 else
                   nil
                 end

    end

    def valid?
      return @factory.valid? if @factory
      false
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
magick_numbers-0.1.3 lib/magick_numbers/regon.rb