Class: Clickup::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/clickup/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Client



9
10
11
12
13
14
15
16
# File 'lib/clickup/client.rb', line 9

def initialize(token)
  @options = {
    headers: {
      "Authorization" => token,
      'Content-Type' => 'application/json'
    }
  }
end

Instance Method Details

#meObject



18
19
20
21
# File 'lib/clickup/client.rb', line 18

def me
  response = self.class.get('/user', @options)
  response['user']
end

#new_task(list_id, task) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/clickup/client.rb', line 23

def new_task(list_id, task)
  response = self.class.post("/list/#{list_id}/task", {
    body: task.to_json
  }.merge(@options))

  response
end