class Slop::FloatOption

Cast the option argument to a Float.

Public Instance Methods

call(value) click to toggle source
# File lib/slop/types.rb, line 54
def call(value)
  # TODO: scientific notation, etc.
  value =~ /\A\d*\.*\d+\z/ && value.to_f
end