class Optimist::IntegerOption

Integer number option class.

Public Instance Methods

parse(paramlist, _neg_given) click to toggle source
# File lib/optimist.rb, line 790
def parse(paramlist, _neg_given)
  paramlist.map do |pg|
    pg.map do |param|
      raise CommandlineError, "option '#{self.name}' needs an integer" unless param.is_a?(Numeric) || param =~ /^-?[\d_]+$/
      param.to_i
    end
  end
end
type_format() click to toggle source
# File lib/optimist.rb, line 789
def type_format ; "=<i>" ; end