Class: ConventionalModels::CLI
- Inherits:
-
Object
- Object
- ConventionalModels::CLI
- Defined in:
- lib/conventional_models/cli.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(arguments) ⇒ CLI
Returns a new instance of CLI.
10 11 12 13 14 |
# File 'lib/conventional_models/cli.rb', line 10 def initialize(arguments) @arguments = arguments @option_parser = OptionParser.new(arguments) @options = @option_parser. end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/conventional_models/cli.rb', line 8 def @options end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/conventional_models/cli.rb', line 16 def run if @option_parser. return output_help if @options.output_help return output_version if @options.output_version if @options.verbose run_console else output_usage end end |