Class: Basecamp::Message
- Defined in:
- lib/basecamp/resources/message.rb
Class Method Summary collapse
-
.archive(project_id, options = {}) ⇒ Object
Returns a summary of all messages in the given project (and category, if specified).
-
.recent(project_id, options = {}) ⇒ Object
Returns the most recent 25 messages in the given project (and category, if specified).
Instance Method Summary collapse
Methods inherited from Resource
all, check_prefix_options, first, last, parent_resources, prefix, #prefix_options, prefix_source
Class Method Details
.archive(project_id, options = {}) ⇒ Object
Returns a summary of all messages in the given project (and category, if specified). The summary is simply the title and category of the message, as well as the number of attachments (if any). Example:
Basecamp::Message.archive(1037)
Basecamp::Message.archive(1037, :category_id => 7301)
23 24 25 |
# File 'lib/basecamp/resources/message.rb', line 23 def self.archive(project_id, = {}) find(:all, :params => .merge(:project_id => project_id), :from => :archive) end |
.recent(project_id, options = {}) ⇒ Object
Returns the most recent 25 messages in the given project (and category, if specified). If you need to retrieve older messages, use the archive method instead. Example:
Basecamp::Message.recent(1037)
Basecamp::Message.recent(1037, :category_id => 7301)
12 13 14 |
# File 'lib/basecamp/resources/message.rb', line 12 def self.recent(project_id, = {}) find(:all, :params => .merge(:project_id => project_id)) end |
Instance Method Details
#comments(options = {}) ⇒ Object
27 28 29 |
# File 'lib/basecamp/resources/message.rb', line 27 def comments( = {}) @comments ||= Comment.find(:all, :params => .merge(:post_id => id)) end |