Class: Asana::Resources::ProjectMembershipsBase
- Defined in:
- lib/asana/resources/gen/project_memberships_base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.get_project_membership(client, project_membership_gid: required("project_membership_gid"), options: {}) ⇒ Object
Get a project membership.
-
.get_project_memberships_for_project(client, project_gid: required("project_gid"), user: nil, options: {}) ⇒ Object
Get memberships from a project.
- .inherited(base) ⇒ Object
Methods inherited from Resource
#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s
Methods included from ResponseHelper
Constructor Details
This class inherits a constructor from Asana::Resources::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource
Class Method Details
.get_project_membership(client, project_membership_gid: required("project_membership_gid"), options: {}) ⇒ Object
Get a project membership
21 22 23 24 25 |
# File 'lib/asana/resources/gen/project_memberships_base.rb', line 21 def get_project_membership(client, project_membership_gid: required("project_membership_gid"), options: {}) path = "/project_memberships/{project_membership_gid}" path["{project_membership_gid}"] = project_membership_gid ProjectMembership.new(parse(client.get(path, options: )).first, client: client) end |
.get_project_memberships_for_project(client, project_gid: required("project_gid"), user: nil, options: {}) ⇒ Object
Get memberships from a project
36 37 38 39 40 41 |
# File 'lib/asana/resources/gen/project_memberships_base.rb', line 36 def get_project_memberships_for_project(client, project_gid: required("project_gid"), user: nil, options: {}) path = "/projects/{project_gid}/project_memberships" path["{project_gid}"] = project_gid params = { user: user }.reject { |_,v| v.nil? || Array(v).empty? } Collection.new(parse(client.get(path, params: params, options: )), type: ProjectMembership, client: client) end |