Method: BBLib::TaskTimer#clear

Defined in:
lib/bblib/core/classes/task_timer.rb

#clear(task = :default) ⇒ NilClass

Removes all history for a given task

Parameters:

  • task (Symbol) (defaults to: :default)

    The name of the task to clear history from.

Returns:

  • (NilClass)

    Returns nil



45
46
47
48
49
# File 'lib/bblib/core/classes/task_timer.rb', line 45

def clear(task = :default)
  return nil unless tasks.keys.include?(task)
  stop task
  tasks[task][:history].clear
end