class Optimist::FloatOption

Floating point number option class.

Public Instance Methods

parse(paramlist, _neg_given) click to toggle source
# File lib/optimist.rb, line 776
def parse(paramlist, _neg_given)
  paramlist.map do |pg|
    pg.map do |param|
      raise CommandlineError, "option '#{self.name}' needs a floating-point number" unless param.is_a?(Numeric) || param =~ FLOAT_RE
      param.to_f
    end
  end
end
type_format() click to toggle source
# File lib/optimist.rb, line 775
def type_format ; "=<f>" ; end