Class: Bob::MetaData::CompanyLists

Inherits:
API
  • Object
show all
Defined in:
lib/bob/api/metadata/company_lists.rb

Constant Summary

Constants inherited from API

API::BASE_URL, API::SANDBOX_URL

Class Method Summary collapse

Methods inherited from API

build_url, create_csv, delete, get, headers, post, post_file, post_media, put

Class Method Details

.add_item(list_name, params = {}) ⇒ Object



16
17
18
# File 'lib/bob/api/metadata/company_lists.rb', line 16

def self.add_item(list_name, params = {})
  post("company/named-lists/#{list_name}", params)
end

.all(options = { includeArchived: false }) ⇒ Object



6
7
8
9
# File 'lib/bob/api/metadata/company_lists.rb', line 6

def self.all(options = { includeArchived: false })
  response = get('company/named-lists', options)
  CompanyListParser.new(response).lists
end

.find(list_name, options = { includeArchived: false }) ⇒ Object



11
12
13
14
# File 'lib/bob/api/metadata/company_lists.rb', line 11

def self.find(list_name, options = { includeArchived: false })
  response = get("company/named-lists/#{list_name}", options)
  CompanyListParser.new(response).list
end

.remove_item(list_name, item_id) ⇒ Object



24
25
26
# File 'lib/bob/api/metadata/company_lists.rb', line 24

def self.remove_item(list_name, item_id)
  delete("company/named-lists/#{list_name}/#{item_id}")
end

.update_item(list_name, item_id, params = {}) ⇒ Object



20
21
22
# File 'lib/bob/api/metadata/company_lists.rb', line 20

def self.update_item(list_name, item_id, params = {})
  put("company/named-lists/#{list_name}/#{item_id}", params)
end