Class: Alternator::CLI
- Inherits:
-
Object
- Object
- Alternator::CLI
- Defined in:
- lib/alternator/cli.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#arguments ⇒ Object
Returns the value of attribute arguments.
Instance Method Summary collapse
- #action_arguments ⇒ Object
- #action_class_const ⇒ Object
-
#initialize(arguments) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(arguments) ⇒ CLI
Returns a new instance of CLI.
5 6 7 |
# File 'lib/alternator/cli.rb', line 5 def initialize(arguments) @arguments = arguments end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/alternator/cli.rb', line 3 def action @action end |
#arguments ⇒ Object
Returns the value of attribute arguments.
3 4 5 |
# File 'lib/alternator/cli.rb', line 3 def arguments @arguments end |
Instance Method Details
#action_arguments ⇒ Object
17 18 19 |
# File 'lib/alternator/cli.rb', line 17 def action_arguments arguments.drop(1) end |
#action_class_const ⇒ Object
13 14 15 |
# File 'lib/alternator/cli.rb', line 13 def action_class_const Alternator::Actions.const_get(arguments.first.capitalize) end |
#run ⇒ Object
21 22 23 |
# File 'lib/alternator/cli.rb', line 21 def run action.execute end |