Class: BasecampAPI::Category

Inherits:
Resource
  • Object
show all
Defined in:
lib/basecamp/basecamp.rb,
lib/basecamp/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_source

Class Method Details

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



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

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

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



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

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



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

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