Class: Panier::Application::CLI
- Inherits:
-
Object
- Object
- Panier::Application::CLI
- Defined in:
- lib/panier/application/cli.rb
Overview
A class responsible for handling the command line interface input.
Constant Summary collapse
- EXIT_SUCCESS =
0- EXIT_FAILURE =
-1
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
-
#run ⇒ Object
The main application loop.
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
12 13 14 15 |
# File 'lib/panier/application/cli.rb', line 12 def initialize I18n.enforce_available_locales = false @service = SalesTaxService.new end |
Instance Method Details
#run ⇒ Object
The main application loop.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/panier/application/cli.rb', line 20 def run begin print_welcome loop do prompt_for_input end rescue SignalException, Interrupt puts "\nExiting..." end EXIT_SUCCESS end |