Class: Basecamp3::Project
- Defined in:
- lib/basecamp3/models/project.rb
Overview
A model for Basecamp's Project (Basecamp)
For more information, see the official Basecamp3 API documentation for Basecamps
Constant Summary
- REQUIRED_FIELDS =
%w(name)
Instance Attribute Summary collapse
-
#bookmarked ⇒ Object
Returns the value of attribute bookmarked.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.all(params = {}) ⇒ Array<Basecamp3::Project>
Returns a paginated list of active projects (basecamps) visible to the current user sorted by most recently created project (basecamp) first.
-
.create(data) ⇒ Basecamp3::Project
Creates a project.
-
.delete(id) ⇒ Boolean
Deletes the project.
-
.find(id) ⇒ Basecamp3::Project
Returns the project (basecamp).
-
.update(id, data) ⇒ Basecamp3::Project
Updates the project.
Methods inherited from Model
Constructor Details
This class inherits a constructor from Basecamp3::Model
Instance Attribute Details
#bookmarked ⇒ Object
Returns the value of attribute bookmarked
5 6 7 |
# File 'lib/basecamp3/models/project.rb', line 5 def bookmarked @bookmarked end |
#created_at ⇒ Object
Returns the value of attribute created_at
5 6 7 |
# File 'lib/basecamp3/models/project.rb', line 5 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description
5 6 7 |
# File 'lib/basecamp3/models/project.rb', line 5 def description @description end |
#id ⇒ Object
Returns the value of attribute id
5 6 7 |
# File 'lib/basecamp3/models/project.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/basecamp3/models/project.rb', line 5 def name @name end |
#status ⇒ Object
Returns the value of attribute status
5 6 7 |
# File 'lib/basecamp3/models/project.rb', line 5 def status @status end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
5 6 7 |
# File 'lib/basecamp3/models/project.rb', line 5 def updated_at @updated_at end |
Class Method Details
.all(params = {}) ⇒ Array<Basecamp3::Project>
Returns a paginated list of active projects (basecamps) visible to the current user sorted by most recently created project (basecamp) first.
will return archived or trashed projects (basecamps) visible to the current user
24 25 26 |
# File 'lib/basecamp3/models/project.rb', line 24 def self.all(params = {}) Basecamp3.request.get("/projects", params, Basecamp3::Project) end |
.create(data) ⇒ Basecamp3::Project
Creates a project.
44 45 46 47 |
# File 'lib/basecamp3/models/project.rb', line 44 def self.create(data) self.validate_required(data) Basecamp3.request.post("/projects", data, Basecamp3::Project) end |
.delete(id) ⇒ Boolean
Deletes the project.
67 68 69 |
# File 'lib/basecamp3/models/project.rb', line 67 def self.delete(id) Basecamp3.request.delete("/projects/#{id}") end |