class OptParseValidator::OptPositiveInteger

Implementation of the Positive Integer Option

Public Instance Methods

validate(value) click to toggle source

@param [ String ] value

@return [ Integer ]

Calls superclass method OptParseValidator::OptInteger#validate
# File lib/opt_parse_validator/opts/positive_integer.rb, line 9
def validate(value)
  i = super(value)
  raise Error, "#{i} is not > 0" unless i.positive?

  i
end