Class: TFA::AddCommand
- Inherits:
-
Object
- Object
- TFA::AddCommand
- Defined in:
- lib/tfa/add_command.rb
Instance Method Summary collapse
-
#initialize(storage) ⇒ AddCommand
constructor
A new instance of AddCommand.
- #run(arguments) ⇒ Object
Constructor Details
#initialize(storage) ⇒ AddCommand
Returns a new instance of AddCommand.
3 4 5 |
# File 'lib/tfa/add_command.rb', line 3 def initialize(storage) @storage = storage end |
Instance Method Details
#run(arguments) ⇒ Object
7 8 9 10 11 |
# File 'lib/tfa/add_command.rb', line 7 def run(arguments) name = arguments.first @storage.save(arguments.first, arguments.last) "Added #{name}" end |