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



87
88
89
# File 'lib/basecamp.rb', line 87

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

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



95
96
97
# File 'lib/basecamp.rb', line 95

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



91
92
93
# File 'lib/basecamp.rb', line 91

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