Class: NightcrawlerSwift::CLI::OptParser
- Inherits:
-
Object
- Object
- NightcrawlerSwift::CLI::OptParser
- Defined in:
- lib/nightcrawler_swift/cli/opt_parser.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(runner) ⇒ OptParser
constructor
A new instance of OptParser.
- #parse! ⇒ Object
Constructor Details
#initialize(runner) ⇒ OptParser
Returns a new instance of OptParser.
6 7 8 9 10 11 |
# File 'lib/nightcrawler_swift/cli/opt_parser.rb', line 6 def initialize runner @runner = runner @parser = OptionParser.new configure_instructions end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
4 5 6 |
# File 'lib/nightcrawler_swift/cli/opt_parser.rb', line 4 def parser @parser end |
Instance Method Details
#help ⇒ Object
17 18 19 |
# File 'lib/nightcrawler_swift/cli/opt_parser.rb', line 17 def help @parser.help end |
#parse! ⇒ Object
13 14 15 |
# File 'lib/nightcrawler_swift/cli/opt_parser.rb', line 13 def parse! @parser.parse!(@runner.argv) end |