Class: UsageMod::IntegerArgumentPlugin
- Inherits:
-
ArgumentParserPlugin
- Object
- ArgumentParserPlugin
- UsageMod::IntegerArgumentPlugin
- Defined in:
- lib/Usage.rb
Instance Attribute Summary
Attributes inherited from ArgumentParserPlugin
Instance Method Summary collapse
-
#initialize(usage_ui, str) ⇒ IntegerArgumentPlugin
constructor
is an error, throw a InvalidIntegerError exception.
Methods inherited from ArgumentParserPlugin
Constructor Details
#initialize(usage_ui, str) ⇒ IntegerArgumentPlugin
is an error, throw a InvalidIntegerError exception.
425 426 427 428 429 430 431 |
# File 'lib/Usage.rb', line 425 def initialize(usage_ui, str) if /^-?\d+/.match(str) then @value = str.to_i else raise InvalidIntegerError.new(str) end end |