Class: Bob::Employee::CustomTables

Inherits:
API
  • Object
show all
Defined in:
lib/bob/api/employee/custom_tables.rb

Constant Summary

Constants inherited from API

API::BASE_URL, API::SANDBOX_URL

Class Method Summary collapse

Methods inherited from API

authorization_header, build_url, content_headers, create_csv, delete, get, post, post_file, post_media, put

Class Method Details

.add_row(employee_id, table_id, row_data) ⇒ Object



11
12
13
# File 'lib/bob/api/employee/custom_tables.rb', line 11

def self.add_row(employee_id, table_id, row_data)
  post("people/custom-tables/#{employee_id}/#{table_id}", {values: row_data})
end

.remove_row(employee_id, table_id, row_id) ⇒ Object



15
16
17
# File 'lib/bob/api/employee/custom_tables.rb', line 15

def self.remove_row(employee_id, table_id, row_id)
  delete("people/custom-tables/#{employee_id}/#{table_id}/#{row_id}")
end

.rows(employee_id, table_id) ⇒ Object



6
7
8
9
# File 'lib/bob/api/employee/custom_tables.rb', line 6

def self.rows(employee_id, table_id)
  response = get("people/custom-tables/#{employee_id}/#{table_id}")
  TableParser.new(response).rows
end