Class: LinkedIn::Companies
- Inherits:
-
APIResource
- Object
- APIResource
- LinkedIn::Companies
- Defined in:
- lib/linked_in/companies.rb
Overview
Companies API
The following API actions do not have corresponding methods in this module
- Permissions Checking Endpoints for Company Shares
- GET Suggested Companies to Follow
- GET Company Products
Instance Method Summary collapse
-
#add_company_share(company_id, share) ⇒ void
Create a share for a company that the authenticated user administers.
-
#company(options = {}) ⇒ LinkedIn::Mash
Retrieve a Company Profile.
-
#company_statistics(options = {}) ⇒ LinkedIn::Mash
Retrieve statistics for a particular company page.
-
#company_updates(options = {}) ⇒ LinkedIn::Mash
Retrieve a feed of event items for a Company.
-
#company_updates_comments(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve comments on a particular company update:.
-
#company_updates_likes(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve likes on a particular company update:.
-
#follow_company(company_id) ⇒ void
(Create) authenticated user starts following a company.
-
#unfollow_company(company_id) ⇒ void
(Destroy) authenticated user stops following a company.
Methods inherited from APIResource
Constructor Details
This class inherits a constructor from LinkedIn::APIResource
Instance Method Details
#add_company_share(company_id, share) ⇒ void
This method returns an undefined value.
Create a share for a company that the authenticated user administers
Permissions: rw_company_admin
96 97 98 99 100 |
# File 'lib/linked_in/companies.rb', line 96 def add_company_share(company_id, share) path = "/companies/#{company_id}/shares" defaults = {visibility: {code: "anyone"}} post(path, defaults.merge(share)) end |
#company(options = {}) ⇒ LinkedIn::Mash
Retrieve a Company Profile
27 28 29 30 |
# File 'lib/linked_in/companies.rb', line 27 def company( = {}) path = company_path() get(path, ) end |
#company_statistics(options = {}) ⇒ LinkedIn::Mash
Retrieve statistics for a particular company page
Permissions: rw_company_admin
54 55 56 57 |
# File 'lib/linked_in/companies.rb', line 54 def company_statistics(={}) path = "#{company_path()}/company-statistics" get(path, ) end |
#company_updates(options = {}) ⇒ LinkedIn::Mash
Retrieve a feed of event items for a Company
41 42 43 44 |
# File 'lib/linked_in/companies.rb', line 41 def company_updates(={}) path = "#{company_path()}/updates" get(path, ) end |
#company_updates_comments(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve comments on a particular company update:
67 68 69 70 |
# File 'lib/linked_in/companies.rb', line 67 def company_updates_comments(update_key, ={}) path = "#{company_path()}/updates/key=#{update_key}/update-comments" get(path, ) end |
#company_updates_likes(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve likes on a particular company update:
80 81 82 83 |
# File 'lib/linked_in/companies.rb', line 80 def company_updates_likes(update_key, ={}) path = "#{company_path()}/updates/key=#{update_key}/likes" get(path, ) end |
#follow_company(company_id) ⇒ void
This method returns an undefined value.
(Create) authenticated user starts following a company
108 109 110 111 |
# File 'lib/linked_in/companies.rb', line 108 def follow_company(company_id) path = "/people/~/following/companies" post(path, {id: company_id}) end |
#unfollow_company(company_id) ⇒ void
This method returns an undefined value.
(Destroy) authenticated user stops following a company
119 120 121 122 |
# File 'lib/linked_in/companies.rb', line 119 def unfollow_company(company_id) path = "/people/~/following/companies/id=#{company_id}" delete(path) end |