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



10
11
12
13
14
# File 'lib/height/api/tasks.rb', line 10

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

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

.search(filter) ⇒ Object



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

def search(filter)
  query = { 'filters' => filter.to_json }
  res = Height::Request.get('tasks', query)

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

.update_task(id_or_index, data) ⇒ Object



16
17
18
19
20
# File 'lib/height/api/tasks.rb', line 16

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

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