Class: HipcallSdk::TaskResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/hipcall/resources/tasks.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from HipcallSdk::Resource

Instance Method Details

#create(**attributes) ⇒ Object



12
13
14
# File 'lib/hipcall/resources/tasks.rb', line 12

def create(**attributes)
	Task.new post_request("tasks", body: attributes).body.dig("data")
end

#list(**params) ⇒ Object



3
4
5
6
# File 'lib/hipcall/resources/tasks.rb', line 3

def list(**params)
	response = get_request("tasks", params: params)
	Collection.from_response(response, key: "data", type: Task)
end

#retrieve(task_id:) ⇒ Object



8
9
10
# File 'lib/hipcall/resources/tasks.rb', line 8

def retrieve(task_id:)
	Task.new get_request("tasks/#{task_id}").body.dig("data")
end