Class: NightcrawlerSwift::CLI::OptParser

Inherits:
Object
  • Object
show all
Defined in:
lib/nightcrawler_swift/cli/opt_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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
  configure_options
end

Instance Attribute Details

#parserObject (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

#helpObject



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