Class: Harvest::API::Tasks

Inherits:
Base
  • Object
show all
Includes:
Behavior::Crud
Defined in:
lib/forecast/api/tasks.rb

Instance Method Summary collapse

Instance Method Details

#activate(task) ⇒ Harvest::Task

Activates the task. Does nothing if the task is already activated

Parameters:

  • task (Harvest::Task)

    the task you want to activate

Returns:

  • (Harvest::Task)

    the activated task



26
27
28
29
30
31
32
# File 'lib/forecast/api/tasks.rb', line 26

def activate(task)
  if !task.active?
    request(:post, credentials, "#{api_model.api_path}/#{task.to_i}/activate", :headers => {'Content-Length' => '0'})
    task.active = true
  end
  task
end