Sha256: 8c9ec287537868a6c9e68b91ce5065cdbdb0956fb6ad79ac39690ca34e4ff40c

Contents?: true

Size: 276 Bytes

Versions: 6

Compression:

Stored size: 276 Bytes

Contents

module BrDocuments
  module IE
    class Factory
      def self.create(uf_symbol, number)
        klass = IE.const_get(uf_symbol.to_s)
        klass.new(number)
      rescue NameError
        raise(ArgumentError, I18n.t('validator.ie.uf.invalid'))
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
br_documents-0.2.5 lib/br_documents/ie/factory.rb
br_documents-0.2.4 lib/br_documents/ie/factory.rb
br_documents-0.2.3 lib/br_documents/ie/factory.rb
br_documents-0.2.2 lib/br_documents/ie/factory.rb
br_documents-0.2.1 lib/br_documents/ie/factory.rb
br_documents-0.2.0 lib/br_documents/ie/factory.rb