Module: Companies
Overview
Companies module adds methods for Company objects
Constant Summary
Constants included from Constants
Constants::ALL_COMPANIES, Constants::ALL_CONTACTS, Constants::ALL_DEALS, Constants::ALL_SUBMITIONS, Constants::API_URL, Constants::AUTHORIZATION_KEY, Constants::CONTENT_TYPE, Constants::CREATE_OR_UPDATE, Constants::DELETE, Constants::EMAIL, Constants::GET, Constants::INDIVIDUAL_COMPANY, Constants::INDIVIDUAL_CONTACT, Constants::INDIVIDUAL_DEAL, Constants::INDIVIDUAL_SUB, Constants::PATCH, Constants::POST, Constants::PROFILE, Constants::PUT, Constants::VID
Instance Method Summary collapse
-
#all_companies ⇒ Object
returns all companies.
-
#create_company(**params) ⇒ Object
creates a company.
-
#delete_company(**params) ⇒ Object
deletes a company.
-
#individual_company_path(id) ⇒ Object
creates an idintificator.
-
#show_company(**params) ⇒ Object
shows a company.
-
#update_company(**params) ⇒ Object
updates a company.
Instance Method Details
#all_companies ⇒ Object
returns all companies
8 9 10 11 12 |
# File 'lib/ruby_hubspot/companies.rb', line 8 def all_companies validate_access_token response(GET, ALL_COMPANIES) end |
#create_company(**params) ⇒ Object
creates a company
15 16 17 18 19 |
# File 'lib/ruby_hubspot/companies.rb', line 15 def create_company(**params) validate_access_token response(POST, INDIVIDUAL_COMPANY, params) end |
#delete_company(**params) ⇒ Object
deletes a company
41 42 43 44 45 46 |
# File 'lib/ruby_hubspot/companies.rb', line 41 def delete_company(**params) validate_access_token id_handler(params[:id]) response(DELETE, individual_company_path(params[:id])) end |
#individual_company_path(id) ⇒ Object
creates an idintificator
49 50 51 |
# File 'lib/ruby_hubspot/companies.rb', line 49 def individual_company_path(id) INDIVIDUAL_COMPANY + id.to_s end |
#show_company(**params) ⇒ Object
shows a company
22 23 24 25 26 27 |
# File 'lib/ruby_hubspot/companies.rb', line 22 def show_company(**params) validate_access_token id_handler(params[:id]) response(GET, individual_company_path(params[:id])) end |
#update_company(**params) ⇒ Object
updates a company
30 31 32 33 34 35 36 37 38 |
# File 'lib/ruby_hubspot/companies.rb', line 30 def update_company(**params) validate_access_token id_handler(params[:id]) params_to_update = params.dup params_to_update.delete(:id) response(PUT, individual_company_path(params[:id]), params_to_update) end |