class Contactually::Tasks

Public Class Methods

new(master) click to toggle source
# File lib/contactually/tasks.rb, line 3
def initialize(master)
  @master = master
end

Public Instance Methods

complete(id, params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 12
def complete(id, params = {})
  hash = @master.call("tasks/#{id}/complete.json", :post, params)
  Contactually::Utils.build_task(hash)
end
create(params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 17
def create(params = {})
  hash = @master.call('tasks.json', :post, params)
  Contactually::Utils.build_task(hash)
end
destroy(id, params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 22
def destroy(id, params = {})
  @master.call("tasks/#{id}.json", :delete, params)
end
generate_followups(params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 26
def generate_followups(params = {})
  @master.call('tasks/generate_followups.json', :post, params)
end
ignore(id, params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 30
def ignore(id, params = {})
  hash = @master.call("tasks/#{id}/ignore.json", :post, params)
  Contactually::Utils.build_task(hash)
end
index(params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 35
def index(params = {})
  hash = @master.call('tasks.json', :get, params)
  Contactually::Utils.tasks_hash_to_objects(hash)
end
show(id, params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 7
def show(id, params = {})
  hash = @master.call("tasks/#{id}.json", :get, params)
  Contactually::Utils.build_task(hash)
end
snooze(id, params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 40
def snooze(id, params = {})
  @master.call("tasks/#{id}/snooze.json", :post, params)
end
update(id, params = {}) click to toggle source
# File lib/contactually/tasks.rb, line 44
def update(id, params = {})
  hash = @master.call("tasks/#{id}.json", :put, params)
  Contactually::Utils.build_task(hash)
end