Class: Basecampx::Project
- Defined in:
- lib/basecampx/resources/project.rb
Instance Attribute Summary collapse
-
#archived ⇒ Object
Returns the value of attribute archived.
-
#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.
-
#starred ⇒ Object
Returns the value of attribute starred.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#accesses ⇒ Object
GET /projects/1/accesses.json.
-
#attachments ⇒ Object
GET /projects/1/attachments.json.
-
#document(document_id) ⇒ Object
GET /projects/1/documents/1.json.
-
#documents ⇒ Object
GET /projects/1/documents.json.
- #events(since = 1.day.ago) ⇒ Object
-
#message(message_id) ⇒ Object
GET /projects/1/messages/1.json.
-
#revoke_access(person_id) ⇒ Object
DELETE /projects/1/accesses/1.json.
-
#todo(todo_id) ⇒ Object
GET /projects/1/todos/1.json will return the specified todo.
-
#todo_list(todo_list_id) ⇒ Object
GET /projects/1/todolists/1.json will return the specified todolist including the todos.
-
#todo_lists(completed = false) ⇒ Object
GET /projects/1/todolists.json shows active todolists for this project sorted by position.
Methods inherited from Resource
#delete, #initialize, parse, #save, #update_attributes
Methods included from Relations
Constructor Details
This class inherits a constructor from Basecampx::Resource
Instance Attribute Details
#archived ⇒ Object
Returns the value of attribute archived.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def archived @archived end |
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def name @name end |
#starred ⇒ Object
Returns the value of attribute starred.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def starred @starred end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def updated_at @updated_at end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/basecampx/resources/project.rb', line 4 def url @url end |
Class Method Details
Instance Method Details
#accesses ⇒ Object
GET /projects/1/accesses.json
50 51 52 |
# File 'lib/basecampx/resources/project.rb', line 50 def accesses Person.parse Basecampx.request "projects/#{self.id}/accesses.json" end |
#attachments ⇒ Object
GET /projects/1/attachments.json
35 36 37 |
# File 'lib/basecampx/resources/project.rb', line 35 def Attachment.parse Basecampx.request "projects/#{self.id}/attachments.json" end |
#document(document_id) ⇒ Object
GET /projects/1/documents/1.json
45 46 47 |
# File 'lib/basecampx/resources/project.rb', line 45 def document document_id Document.new Basecampx.request "projects/#{self.id}/documents/#{document_id}.json" end |
#documents ⇒ Object
GET /projects/1/documents.json
40 41 42 |
# File 'lib/basecampx/resources/project.rb', line 40 def documents Document.parse Basecampx.request "projects/#{self.id}/documents.json" end |
#events(since = 1.day.ago) ⇒ Object
30 31 32 |
# File 'lib/basecampx/resources/project.rb', line 30 def events since=1.day.ago Event.parse Basecampx.request "/projects/#{self.id}/events.json?since=#{since.to_time.iso8601}" end |
#message(message_id) ⇒ Object
GET /projects/1/messages/1.json
69 70 71 |
# File 'lib/basecampx/resources/project.rb', line 69 def Message.parse Basecampx.request "projects/#{self.id}/messages/#{}.json" end |
#revoke_access(person_id) ⇒ Object
DELETE /projects/1/accesses/1.json
60 61 62 63 64 65 66 |
# File 'lib/basecampx/resources/project.rb', line 60 def revoke_access person_id if person_id.class.name == 'Basecampx::Person' person_id = person_id.id end Basecampx.delete "projects/#{self.id}/accesses/#{person_id}.json" end |
#todo(todo_id) ⇒ Object
GET /projects/1/todos/1.json will return the specified todo.
15 16 17 |
# File 'lib/basecampx/resources/project.rb', line 15 def todo todo_id Todo.new Basecampx.request "projects/#{self.id}/todos/#{todo_id}.json" end |
#todo_list(todo_list_id) ⇒ Object
GET /projects/1/todolists/1.json will return the specified todolist including the todos.
26 27 28 |
# File 'lib/basecampx/resources/project.rb', line 26 def todo_list todo_list_id TodoList.new Basecampx.request "projects/#{self.id}/todolists/#{todo_list_id}.json" end |
#todo_lists(completed = false) ⇒ Object
GET /projects/1/todolists.json shows active todolists for this project sorted by position. GET /projects/1/todolists/completed.json shows completed todolists for this project.
21 22 23 |
# File 'lib/basecampx/resources/project.rb', line 21 def todo_lists completed=false TodoList.parse Basecampx.request "projects/#{self.id}/todolists#{completed ? '/completed' : ''}.json" end |