Sha256: c0804b1b1a33649cf2b2d319a789b4d8e0ac422a3ca346c7c9759857c8b11e19

Contents?: true

Size: 291 Bytes

Versions: 5

Compression:

Stored size: 291 Bytes

Contents

module Formulario
  class Field
    class Integer < Field
      private

      def self.build(raw_value)
        new Integer(raw_value)
      rescue ArgumentError, TypeError => e
        ExceptionalValue.new(raw_value, reasons: ['needs to represent an integer'])
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
formulario-0.1.3 lib/formulario/fields/integer.rb
formulario-0.1.2 lib/formulario/fields/integer.rb
formulario-0.1.1b lib/formulario/fields/integer.rb
formulario-0.1.1 lib/formulario/fields/integer.rb
formulario-0.1.0 lib/formulario/fields/integer.rb