Class: Clickup::Client
- Inherits:
-
Object
- Object
- Clickup::Client
- Includes:
- HTTParty
- Defined in:
- lib/clickup/client.rb
Instance Method Summary collapse
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
- #me ⇒ Object
- #new_task(list_id, task) ⇒ Object
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
#me ⇒ Object
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 |