Class: Height::API::Tasks

Inherits:
Object
  • Object
show all
Defined in:
lib/height/api/tasks.rb

Class Method Summary collapse

Class Method Details

.get(id_or_index) ⇒ Object



13
14
15
16
17
# File 'lib/height/api/tasks.rb', line 13

def get(id_or_index)
  res = Height::Request.get("tasks/#{id_or_index}")

  Height::Response.parse(res.body)
end

.search(filter, incl = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/height/api/tasks.rb', line 3

def search(filter, incl = nil)
  query = { 'filters' => filter.to_json }

  query.merge!({ 'include' => incl.to_json }) if incl

  res = Height::Request.get('tasks', query)

  Height::ListResponse.parse(res.body)
end

.update_task(id_or_index, data) ⇒ Object



19
20
21
22
23
# File 'lib/height/api/tasks.rb', line 19

def update_task(id_or_index, data)
  res = Height::Request.put("tasks/#{id_or_index}", data)

  Height::Response.parse(res.body)
end