Class: Basecamp::Message

Inherits:
Resource
  • Object
show all
Defined in:
lib/basecamp.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

element_name, 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)


267
268
269
# File 'lib/basecamp.rb', line 267

def self.archive(project_id, options = {})
  find(:all, :params => options.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)


256
257
258
# File 'lib/basecamp.rb', line 256

def self.recent(project_id, options = {})
  find(:all, :params => options.merge(:project_id => project_id))
end

Instance Method Details

#comments(options = {}) ⇒ Object



271
272
273
# File 'lib/basecamp.rb', line 271

def comments(options = {})
  @comments ||= Comment.find(:all, :params => options.merge(:post_id => id))
end