Class: Opener::Webservice::OptParser
- Inherits:
-
Object
- Object
- Opener::Webservice::OptParser
- Defined in:
- lib/opener/webservice/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.
9 10 11 12 |
# File 'lib/opener/webservice/opt_parser.rb', line 9 def initialize(&block) @options = {} @option_parser = construct_option_parser(, &block) end |
Instance Attribute Details
#option_parser ⇒ Object
Returns the value of attribute option_parser.
7 8 9 |
# File 'lib/opener/webservice/opt_parser.rb', line 7 def option_parser @option_parser end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/opener/webservice/opt_parser.rb', line 7 def @options end |
Class Method Details
.parse(args) ⇒ Object
32 33 34 |
# File 'lib/opener/webservice/opt_parser.rb', line 32 def self.parse(args) new.parse(args) end |
.parse!(args) ⇒ Object
36 37 38 |
# File 'lib/opener/webservice/opt_parser.rb', line 36 def self.parse!(args) new.parse!(args) end |
.pre_parse(args) ⇒ Object
44 45 46 |
# File 'lib/opener/webservice/opt_parser.rb', line 44 def self.pre_parse(args) new.pre_parse(args) end |
.pre_parse!(args) ⇒ Object
40 41 42 |
# File 'lib/opener/webservice/opt_parser.rb', line 40 def self.pre_parse!(args) new.pre_parse!(args) end |
Instance Method Details
#parse(args) ⇒ Object
14 15 16 |
# File 'lib/opener/webservice/opt_parser.rb', line 14 def parse(args) process(:parse, args) end |
#parse!(args) ⇒ Object
18 19 20 |
# File 'lib/opener/webservice/opt_parser.rb', line 18 def parse!(args) process(:parse!, args) end |
#pre_parse(args) ⇒ Object
27 28 29 30 |
# File 'lib/opener/webservice/opt_parser.rb', line 27 def pre_parse(args) delete_double_dash = false process(:parse, args, delete_double_dash) end |
#pre_parse!(args) ⇒ Object
22 23 24 25 |
# File 'lib/opener/webservice/opt_parser.rb', line 22 def pre_parse!(args) delete_double_dash = false process(:parse!, args, delete_double_dash) end |