Module: Camper::Client::PeopleAPI
- Included in:
- Camper::Client
- Defined in:
- lib/camper/api/people.rb
Overview
Defines methods related to people.
Instance Method Summary collapse
-
#people ⇒ PaginatedResponse<Resource>
Get all people visible to the current user.
-
#people_in_project(project) ⇒ PaginatedResponse<Resource>
Get all active people on the project with the given ID.
-
#person(id) ⇒ Resource
Get the profile for the user with the given ID.
-
#pingable_people ⇒ PaginatedResponse<Resource>
Get all people on this Basecamp account who can be pinged.
-
#profile ⇒ Resource
Get the current user’s personal info.
-
#update_access_in_project(project, options = {}) ⇒ Resource
Allows granting new and existing people access to a project, and revoking access from existing people.
Instance Method Details
#people ⇒ PaginatedResponse<Resource>
Get all people visible to the current user
15 16 17 |
# File 'lib/camper/api/people.rb', line 15 def people get('/people') end |
#people_in_project(project) ⇒ PaginatedResponse<Resource>
Get all active people on the project with the given ID
31 32 33 34 35 |
# File 'lib/camper/api/people.rb', line 31 def people_in_project(project) id = project.respond_to?(:id) ? project.id : project get("/projects/#{id}/people") end |
#person(id) ⇒ Resource
Get the profile for the user with the given ID
83 84 85 |
# File 'lib/camper/api/people.rb', line 83 def person(id) get("/people/#{id}") end |
#pingable_people ⇒ PaginatedResponse<Resource>
Get all people on this Basecamp account who can be pinged
71 72 73 |
# File 'lib/camper/api/people.rb', line 71 def pingable_people get('/circles/people') end |
#profile ⇒ Resource
Get the current user’s personal info.
94 95 96 |
# File 'lib/camper/api/people.rb', line 94 def profile get('/my/profile') end |
#update_access_in_project(project, options = {}) ⇒ Resource
Allows granting new and existing people access to a project, and revoking access from existing people.
56 57 58 59 60 61 62 |
# File 'lib/camper/api/people.rb', line 56 def update_access_in_project(project, = {}) raise Camper::Error::InvalidParameter, 'options cannot be empty' if .empty? id = project.respond_to?(:id) ? project.id : project put("/projects/#{id}/people/users", body: { ** }) end |