Class: Ztodo::Controller
- Inherits:
-
Object
- Object
- Ztodo::Controller
- Defined in:
- lib/ztodo/controller.rb
Overview
Class for processing user commands.
This class uses Ztodo::Project and Ztodo::Converter classes
Instance Method Summary collapse
-
#execute!(args) ⇒ Object
Execute necessary command.
-
#initialize ⇒ Controller
constructor
A new instance of Controller.
Constructor Details
Instance Method Details
#execute!(args) ⇒ Object
Execute necessary command
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ztodo/controller.rb', line 14 def execute! args return cmd_list if args.empty? handler = args[0] if methods.include? ('cmd_'+handler).to_sym args.slice! 0 method(('cmd_'+handler).to_sym).call args else cmd_help end end |