Class: MicroManager::CLI::CompleteTask
- Inherits:
-
Object
- Object
- MicroManager::CLI::CompleteTask
- Defined in:
- lib/cli/complete_task.rb
Instance Method Summary collapse
-
#initialize(prompt: TTY::Prompt.new) ⇒ CompleteTask
constructor
A new instance of CompleteTask.
- #run(schedule:) ⇒ Object
Constructor Details
#initialize(prompt: TTY::Prompt.new) ⇒ CompleteTask
Returns a new instance of CompleteTask.
8 9 10 |
# File 'lib/cli/complete_task.rb', line 8 def initialize(prompt: TTY::Prompt.new) @prompt = prompt end |
Instance Method Details
#run(schedule:) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cli/complete_task.rb', line 12 def run(schedule:) tasks = schedule.outstanding_tasks = tasks.map { |task| { task.description => task } } << { "Exit" => nil } Result.new do task = prompt.select("Complete task", ) task&.complete nil end end |