Class: BugherdClient::Resources::Project
- Defined in:
- lib/bugherd_client/resources/project.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#active ⇒ Object
Get all active projects.
-
#add_guest(project_id, attributes = {}) ⇒ Object
Add an existing guest to a project, or invite someone by email address.
-
#add_member(project_id, attributes = {}) ⇒ Object
Add an existing guest to a project, or invite someone by email address.
-
#all ⇒ Object
Get more detail of your account.
-
#create(attributes = {}) ⇒ Object
Create a Project, will initially have no members attributes: name, devurl, is_public, is_active.
-
#delete(project_id) ⇒ Object
Delete a project and all associated data.
-
#find(project_id) ⇒ Object
Show details for a specific project.
-
#update(project_id, attributes = {}) ⇒ Object
Update settings for an existing project under your control (ie: only the ones you own).
Methods inherited from Base
#initialize, #parse_response, #send_request
Constructor Details
This class inherits a constructor from BugherdClient::Resources::Base
Instance Method Details
#active ⇒ Object
Get all active projects
70 71 72 73 |
# File 'lib/bugherd_client/resources/project.rb', line 70 def active raw_response = get_request('projects/active') parse_response(raw_response, :projects) end |
#add_guest(project_id, attributes = {}) ⇒ Object
Add an existing guest to a project, or invite someone by email address. required: project_id attributes: user_id, email API: 2
51 52 53 54 |
# File 'lib/bugherd_client/resources/project.rb', line 51 def add_guest(project_id, attributes={}) raw_response = post_request("projects/#{project_id}/add_guest", attributes) parse_response(raw_response) end |
#add_member(project_id, attributes = {}) ⇒ Object
Add an existing guest to a project, or invite someone by email address. required: project_id attributes: user_id
61 62 63 64 |
# File 'lib/bugherd_client/resources/project.rb', line 61 def add_member(project_id, attributes={}) raw_response = post_request("projects/#{project_id}/add_member", attributes) parse_response(raw_response) end |
#all ⇒ Object
Get more detail of your account.
8 9 10 11 |
# File 'lib/bugherd_client/resources/project.rb', line 8 def all raw_response = get_request('projects') parse_response(raw_response, :projects) end |
#create(attributes = {}) ⇒ Object
Create a Project, will initially have no members attributes: name, devurl, is_public, is_active
25 26 27 28 |
# File 'lib/bugherd_client/resources/project.rb', line 25 def create(attributes={}) raw_response = post_request("projects", project: attributes) parse_response(raw_response, :project) end |
#delete(project_id) ⇒ Object
Delete a project and all associated data. Use with care, deleted projects cannot be recovered. API: 1,2
41 42 43 44 |
# File 'lib/bugherd_client/resources/project.rb', line 41 def delete(project_id) raw_response = delete_request("projects/#{project_id}") parse_response(raw_response) end |
#find(project_id) ⇒ Object
Show details for a specific project
16 17 18 19 |
# File 'lib/bugherd_client/resources/project.rb', line 16 def find(project_id) raw_response = get_request("projects/#{project_id}") parse_response(raw_response, :project) end |
#update(project_id, attributes = {}) ⇒ Object
Update settings for an existing project under your control (ie: only the ones you own). API: 1,2
33 34 35 36 |
# File 'lib/bugherd_client/resources/project.rb', line 33 def update(project_id, attributes={}) raw_response = put_request("projects/#{project_id}", project: attributes) parse_response(raw_response, :project) end |