Class: Opener::Daemons::OptParser
- Inherits:
-
Object
- Object
- Opener::Daemons::OptParser
- Defined in:
- lib/opener/daemons/opt_parser.rb
Instance Attribute Summary collapse
-
#option_parser ⇒ Object
Returns the value of attribute option_parser.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(&block) ⇒ OptParser
constructor
A new instance of OptParser.
- #parse(args) ⇒ Object
- #parse!(args) ⇒ Object
- #pre_parse(args) ⇒ Object
- #pre_parse!(args) ⇒ Object
Constructor Details
#initialize(&block) ⇒ OptParser
Returns a new instance of OptParser.
8 9 10 11 |
# File 'lib/opener/daemons/opt_parser.rb', line 8 def initialize(&block) = {} @option_parser = construct_option_parser(, &block) end |
Instance Attribute Details
#option_parser ⇒ Object
Returns the value of attribute option_parser.
6 7 8 |
# File 'lib/opener/daemons/opt_parser.rb', line 6 def option_parser @option_parser end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/opener/daemons/opt_parser.rb', line 6 def end |
Class Method Details
.parse(args) ⇒ Object
31 32 33 |
# File 'lib/opener/daemons/opt_parser.rb', line 31 def self.parse(args) new.parse(args) end |
.parse!(args) ⇒ Object
35 36 37 |
# File 'lib/opener/daemons/opt_parser.rb', line 35 def self.parse!(args) new.parse!(args) end |
.pre_parse(args) ⇒ Object
43 44 45 |
# File 'lib/opener/daemons/opt_parser.rb', line 43 def self.pre_parse(args) new.pre_parse(args) end |
.pre_parse!(args) ⇒ Object
39 40 41 |
# File 'lib/opener/daemons/opt_parser.rb', line 39 def self.pre_parse!(args) new.pre_parse!(args) end |
Instance Method Details
#parse(args) ⇒ Object
13 14 15 |
# File 'lib/opener/daemons/opt_parser.rb', line 13 def parse(args) process(:parse, args) end |
#parse!(args) ⇒ Object
17 18 19 |
# File 'lib/opener/daemons/opt_parser.rb', line 17 def parse!(args) process(:parse!, args) end |
#pre_parse(args) ⇒ Object
26 27 28 29 |
# File 'lib/opener/daemons/opt_parser.rb', line 26 def pre_parse(args) delete_double_dash = false process(:parse, args, delete_double_dash) end |
#pre_parse!(args) ⇒ Object
21 22 23 24 |
# File 'lib/opener/daemons/opt_parser.rb', line 21 def pre_parse!(args) delete_double_dash = false process(:parse!, args, delete_double_dash) end |