Class: Nin::Integration::Todoist::Client::Project

Inherits:
BaseClient show all
Defined in:
lib/nin/integration/todoist/client/project.rb

Constant Summary collapse

API_URI =
"#{BASE_URI}/projects".freeze

Instance Method Summary collapse

Methods inherited from BaseClient

#initialize

Constructor Details

This class inherits a constructor from Nin::Integration::Todoist::Client::BaseClient

Instance Method Details

#get(id) ⇒ Object



8
9
10
11
12
13
# File 'lib/nin/integration/todoist/client/project.rb', line 8

def get(id)
  res = HTTP.headers(accept: "application/json")
    .get("#{API_URI}/get", params: { token: @token, project_id: id })

  JSON.parse(res.body.to_s)['project']
end