Class: Asana::Task

Inherits:
Resource
  • Object
show all
Defined in:
lib/asana/resources/task.rb

Instance Method Summary collapse

Methods inherited from Resource

collection_path, custom_method_collection_url, element_path, #method_not_allowed, new_element_path, #reload, remove_json_extension, singleton_path, #to_json

Instance Method Details

#add_project(project) ⇒ Object



8
9
10
11
# File 'lib/asana/resources/task.rb', line 8

def add_project(project)
  project = project.id if project.is_a?(Project)
  post('addProject', nil, {data: {project: project}}.to_json)
end

#add_tag(tag) ⇒ Object



18
19
20
21
# File 'lib/asana/resources/task.rb', line 18

def add_tag(tag)
  tag = tag.id if tag.is_a?(Tag)
  post('addTag', nil, {data: {tag: tag}}.to_json)
end

#remove_project(project) ⇒ Object



13
14
15
16
# File 'lib/asana/resources/task.rb', line 13

def remove_project(project)
  project = project.id if project.is_a?(Project)
  post('removeProject', nil, {data: {project: project}}.to_json)
end

#remove_tag(tag) ⇒ Object



23
24
25
26
# File 'lib/asana/resources/task.rb', line 23

def remove_tag(tag)
  tag = tag.id if tag.is_a?(Tag)
  post('removeTag', nil, {data: {tag: tag}}.to_json)
end