Class: MicroManager::CLI::AddTask

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/add_task.rb

Instance Method Summary collapse

Constructor Details

#initialize(description:, due: Date.today) ⇒ AddTask

Returns a new instance of AddTask.



6
7
8
9
# File 'lib/cli/add_task.rb', line 6

def initialize(description:, due: Date.today)
  @description = description
  @due = due
end

Instance Method Details

#run(schedule:) ⇒ Object



11
12
13
14
15
# File 'lib/cli/add_task.rb', line 11

def run(schedule:)
  schedule.add_task(description: description, due: due)

  Result.new { "Task added successfully" }
end