Class: Moodwall::Optparse
- Inherits:
-
Object
- Object
- Moodwall::Optparse
- Defined in:
- lib/moodwall/optparse.rb
Defined Under Namespace
Classes: ScriptOptions
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(options = ScriptOptions.new) ⇒ Optparse
constructor
A new instance of Optparse.
- #parse(args) ⇒ Object
Constructor Details
#initialize(options = ScriptOptions.new) ⇒ Optparse
Returns a new instance of Optparse.
7 8 9 |
# File 'lib/moodwall/optparse.rb', line 7 def initialize( = ScriptOptions.new) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/moodwall/optparse.rb', line 5 def @options end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
5 6 7 |
# File 'lib/moodwall/optparse.rb', line 5 def parser @parser end |
Instance Method Details
#parse(args) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/moodwall/optparse.rb', line 11 def parse(args) @args = OptionParser.new do |parser| .(parser) parser.parse!(args) end end |