Class: BugherdClient::Resources::V1::Project
- Defined in:
- lib/bugherd_client/resources/v1/project.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#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
#api_methods, #initialize, #parse_response, #send_request
Constructor Details
This class inherits a constructor from BugherdClient::Resources::V1::Base
Instance Method Details
#all ⇒ Object
Get more detail of your account.
10 11 12 13 |
# File 'lib/bugherd_client/resources/v1/project.rb', line 10 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
27 28 29 30 |
# File 'lib/bugherd_client/resources/v1/project.rb', line 27 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.
43 44 45 46 |
# File 'lib/bugherd_client/resources/v1/project.rb', line 43 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
18 19 20 21 |
# File 'lib/bugherd_client/resources/v1/project.rb', line 18 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).
35 36 37 38 |
# File 'lib/bugherd_client/resources/v1/project.rb', line 35 def update(project_id, attributes={}) raw_response = put_request("projects/#{project_id}", project: attributes) parse_response(raw_response, :project) end |