Class: BasecampAPI::Message

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

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


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

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)


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

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

Instance Method Details

#comments(options = {}) ⇒ Object



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

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