Sha256: aa2fb51223f0c64fcf35bfc5eda10c908a907571b4de7b6703a26bf0d2db1cc4

Contents?: true

Size: 293 Bytes

Versions: 6

Compression:

Stored size: 293 Bytes

Contents

module OptParseValidator
  # Implementation of the Integer Option
  class OptInteger < OptBase
    # @param [ String ] value
    #
    # @return [ Integer ]
    def validate(value)
      raise Error, "#{value} is not an integer" if value.to_i.to_s != value

      value.to_i
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opt_parse_validator-0.0.17.0 lib/opt_parse_validator/opts/integer.rb
opt_parse_validator-0.0.16.6 lib/opt_parse_validator/opts/integer.rb
opt_parse_validator-0.0.16.5 lib/opt_parse_validator/opts/integer.rb
opt_parse_validator-0.0.16.4 lib/opt_parse_validator/opts/integer.rb
opt_parse_validator-0.0.16.3 lib/opt_parse_validator/opts/integer.rb
opt_parse_validator-0.0.16.2 lib/opt_parse_validator/opts/integer.rb