Class: Basecamp3::TodoList
- Includes:
- Concerns::Bucketable, Concerns::Commentable, Concerns::Creatorable, Concerns::Parentable, Concerns::Recordingable
- Defined in:
- lib/basecamp3/models/todo_list.rb
Overview
A model for Basecamp's TODO List
For more information, see the official Basecamp3 API documentation for TODO lists
Constant Summary
- REQUIRED_FIELDS =
%w(name)
Instance Attribute Summary collapse
-
#completed ⇒ Object
Returns the value of attribute completed.
-
#completed_ratio ⇒ Object
Returns the value of attribute completed_ratio.
-
#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.
Attributes included from Concerns::Commentable
Class Method Summary collapse
-
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::TodoList>
Returns a paginated list of active TODO lists.
-
.create(bucket_id, parent_id, data) ⇒ Basecamp3::TodoList
Creates a TODO list.
-
.find(bucket_id, id) ⇒ Basecamp3::TodoList
Returns the TODO list.
-
.update(bucket_id, id, data) ⇒ Basecamp3::TodoList
Updates the TODO list.
Instance Method Summary collapse
-
#todos ⇒ Array<Basecamp3::Todo>
Returns a list of related todos.
Methods included from Concerns::Commentable
Methods included from Concerns::Recordingable
Methods included from Concerns::Parentable
Methods included from Concerns::Bucketable
Methods included from Concerns::Creatorable
Methods inherited from Model
Constructor Details
This class inherits a constructor from Basecamp3::Model
Instance Attribute Details
#completed ⇒ Object
Returns the value of attribute completed
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def completed @completed end |
#completed_ratio ⇒ Object
Returns the value of attribute completed_ratio
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def completed_ratio @completed_ratio end |
#created_at ⇒ Object
Returns the value of attribute created_at
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def description @description end |
#id ⇒ Object
Returns the value of attribute id
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def id @id end |
#name ⇒ Object
Returns the value of attribute name
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def name @name end |
#status ⇒ Object
Returns the value of attribute status
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def status @status end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
11 12 13 |
# File 'lib/basecamp3/models/todo_list.rb', line 11 def updated_at @updated_at end |
Class Method Details
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::TodoList>
Returns a paginated list of active TODO lists.
36 37 38 |
# File 'lib/basecamp3/models/todo_list.rb', line 36 def self.all(bucket_id, parent_id, params = {}) Basecamp3.request.get("/buckets/#{bucket_id}/todosets/#{parent_id}/todolists", params, Basecamp3::TodoList) end |
.create(bucket_id, parent_id, data) ⇒ Basecamp3::TodoList
Creates a TODO list.
59 60 61 62 |
# File 'lib/basecamp3/models/todo_list.rb', line 59 def self.create(bucket_id, parent_id, data) self.validate_required(data) Basecamp3.request.post("/buckets/#{bucket_id}/todosets/#{parent_id}/todolists", data, Basecamp3::TodoList) end |
Instance Method Details
#todos ⇒ Array<Basecamp3::Todo>
Returns a list of related todos.
25 26 27 |
# File 'lib/basecamp3/models/todo_list.rb', line 25 def todos @mapped_todos ||= Basecamp3::Todo.all(bucket.id, id) end |