Class: TrafficLightController::CLI
- Inherits:
-
Object
- Object
- TrafficLightController::CLI
- Includes:
- CommandLineHelper::HelpText
- Defined in:
- lib/traffic_light_controller/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #process_command_line_options ⇒ Object
- #run ⇒ Object
Constructor Details
Class Method Details
.run ⇒ Object
8 9 10 11 12 13 |
# File 'lib/traffic_light_controller/cli.rb', line 8 def run change_program_name cli = self.new cli. cli.run end |
Instance Method Details
#process_command_line_options ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/traffic_light_controller/cli.rb', line 20 def GetoptLong.new(*).each do |opt, arg| case opt when '--help' show_help_and_exit when '--version' show_version_info_and_exit end end end |
#run ⇒ Object
31 32 33 |
# File 'lib/traffic_light_controller/cli.rb', line 31 def run server.work end |