Class: OptParseSimple
- Inherits:
-
Object
- Object
- OptParseSimple
- Extended by:
- IndifferentVariableHash
- Defined in:
- lib/optparse-simple.rb,
lib/optparse-simple.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Option
Instance Attribute Summary collapse
-
#options ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#initialize(&block) ⇒ OptParseSimple
constructor
whether or not OptParseSimple acts like OptionParser.
- #on(*args, &block) ⇒ Object
- #parse(args) ⇒ Object
- #parse!(args) ⇒ Object
Constructor Details
#initialize(&block) ⇒ OptParseSimple
whether or not OptParseSimple acts like OptionParser
15 16 17 |
# File 'lib/optparse-simple.rb', line 15 def initialize &block block.call self end |
Instance Attribute Details
#options ⇒ Object
:nodoc:
10 11 12 |
# File 'lib/optparse-simple.rb', line 10 def @options end |
Instance Method Details
#on(*args, &block) ⇒ Object
34 35 36 |
# File 'lib/optparse-simple.rb', line 34 def on *args, &block << Option.new(*args, &block) end |
#parse(args) ⇒ Object
19 20 21 22 |
# File 'lib/optparse-simple.rb', line 19 def parse args (args) if OptParseSimple.compatibility_mode .each {|option| option.parse(args) } end |
#parse!(args) ⇒ Object
24 25 26 27 |
# File 'lib/optparse-simple.rb', line 24 def parse! args (args) if OptParseSimple.compatibility_mode .each {|option| option.parse!(args) } end |