Sha256: 8215e9aa995259508deb31fbfc180da99044f59ec3de0e059bf89b5c1b390133

Contents?: true

Size: 320 Bytes

Versions: 5

Compression:

Stored size: 320 Bytes

Contents

module BBLib
  class OptsParser
    class Float < BasicOption

      protected

      def format_value(value)
        raise InvalidArgumentException, "Argument provided for #{name} should be an float but was '#{args[index]}'" unless value =~ /^\d+(\.\d+)?$/
        value.to_f
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bblib-2.0.5 lib/bblib/cli/options/float.rb
bblib-2.0.4 lib/bblib/cli/options/float.rb
bblib-2.0.3 lib/bblib/cli/options/float.rb
bblib-2.0.1 lib/bblib/cli/options/float.rb
bblib-2.0.0 lib/bblib/cli/options/float.rb