Method: Tracking::List#rename

Defined in:
lib/tracking/list.rb

#rename(name) ⇒ Object

Renames the last task in the list

Parameters:

  • the new name for the last task



80
81
82
83
84
85
86
87
# File 'lib/tracking/list.rb', line 80

def rename name
  # get task data
  old_task = get(1).first
  # delete last task
  delete
  # add new task with old time
  add(name, old_task.raw(:start_time))
end