Module: TurbaKit::CrowdTable

Included in:
Client
Defined in:
lib/turba_kit/crowd_table.rb

Instance Method Summary collapse

Instance Method Details

#create_service_crowd_table(service_id, options = {}) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/turba_kit/crowd_table.rb', line 24

def create_service_crowd_table(service_id, options = {})
  post_request("/services/#{service_id}/crowd_table", {
    namespace: :crowd_table,
    params: {
      crowd_table: options
    }
  })
end

#delete_service_crowd_table(service_id, options = {}) ⇒ Object



33
34
35
# File 'lib/turba_kit/crowd_table.rb', line 33

def delete_service_crowd_table(service_id, options = {})
  delete_request("/services/#{service_id}/crowd_table")
end

#service_crowd_table(service_id, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/turba_kit/crowd_table.rb', line 3

def service_crowd_table(service_id, options = {})
  default = {
    from: Time.now.beginning_of_day.to_datetime.new_offset(0).to_i,
    to: (Time.now + 6.days).beginning_of_day.to_datetime.new_offset(0).to_i
  }

  get_request("/services/#{service_id}/crowd_table", {
    namespace: :crowd_table,
    params: default.merge(options)
  })
end

#update_service_crowd_table(service_id, crowd_table_id, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/turba_kit/crowd_table.rb', line 15

def update_service_crowd_table(service_id, crowd_table_id, options = {})
  put_request("/services/#{service_id}/crowd_tables/#{crowd_table_id}", {
    namespace: :crowd_table,
    params: {
      crowd_table: options
    }
  })
end