Class: CirroIOV2::Resources::Gig

Inherits:
Base
  • Object
show all
Defined in:
lib/cirro_io_v2/resources/gig.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize, #resource_root

Constructor Details

This class inherits a constructor from CirroIOV2::Resources::Base

Instance Method Details

#archive(id, params = nil) ⇒ Object



19
20
21
22
# File 'lib/cirro_io_v2/resources/gig.rb', line 19

def archive(id, params = nil)
  response = client.request_client.request(:post, "#{resource_root}/#{id}/archive", body: params)
  Responses::GigResponse.new(response.body)
end

#create(params) ⇒ Object



9
10
11
12
# File 'lib/cirro_io_v2/resources/gig.rb', line 9

def create(params)
  response = client.request_client.request(:post, resource_root, body: params)
  Responses::GigResponse.new(response.body)
end

#delete(id) ⇒ Object



24
25
26
27
# File 'lib/cirro_io_v2/resources/gig.rb', line 24

def delete(id)
  response = client.request_client.request(:delete, "#{resource_root}/#{id}")
  Responses::GigDeleteResponse.new(response.body)
end

#find(id) ⇒ Object



4
5
6
7
# File 'lib/cirro_io_v2/resources/gig.rb', line 4

def find(id)
  response = client.request_client.request(:get, [resource_root, id].join('/'))
  Responses::GigResponse.new(response.body)
end

#invite(id, params) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/cirro_io_v2/resources/gig.rb', line 39

def invite(id, params)
  response = client.request_client.request(:post, "#{resource_root}/#{id}/invite", body: params)

  return Responses::GigInvitationResponse.new(response.body) if response.body['object'] == 'gig_invitation'

  Responses::GigInvitationListResponse.new(response.body) if response.body['object'] == 'list'
end

#tasks(id, params) ⇒ Object



29
30
31
32
# File 'lib/cirro_io_v2/resources/gig.rb', line 29

def tasks(id, params)
  response = client.request_client.request(:post, "#{resource_root}/#{id}/tasks", body: params)
  Responses::GigTaskResponse.new(response.body)
end

#update(id, params) ⇒ Object



14
15
16
17
# File 'lib/cirro_io_v2/resources/gig.rb', line 14

def update(id, params)
  response = client.request_client.request(:post, "#{resource_root}/#{id}", body: params)
  Responses::GigResponse.new(response.body)
end

#update_task(gig_id, task_id, params) ⇒ Object



34
35
36
37
# File 'lib/cirro_io_v2/resources/gig.rb', line 34

def update_task(gig_id, task_id, params)
  response = client.request_client.request(:post, "#{resource_root}/#{gig_id}/tasks/#{task_id}", body: params)
  Responses::GigTaskResponse.new(response.body)
end