Class: Basecamp::Category

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

Overview

Creating different types of categories

The type parameter is required when creating a category. For exampe, to create an attachment category for a particular project:

c = Basecamp::Category.new(:project_id => 1037)
c.type = 'attachment'
c.name = 'Pictures'
c.save # => true

Class Method Summary collapse

Methods inherited from Resource

element_name, parent_resources, prefix, #prefix_options, prefix_source

Class Method Details

.all(project_id, options = {}) ⇒ Object



232
233
234
# File 'lib/basecamp.rb', line 232

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

.attachment_categories(project_id, options = {}) ⇒ Object



240
241
242
# File 'lib/basecamp.rb', line 240

def self.attachment_categories(project_id, options = {})
  find(:all, :params => options.merge(:project_id => project_id, :type => 'attachment'))
end

.post_categories(project_id, options = {}) ⇒ Object



236
237
238
# File 'lib/basecamp.rb', line 236

def self.post_categories(project_id, options = {})
  find(:all, :params => options.merge(:project_id => project_id, :type => 'post'))
end