class BBLib::OptsParser::Float

Protected Instance Methods

format_value(value) click to toggle source
# File lib/bblib/cli/options/float.rb, line 7
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