Class: BasecampAPI::TodoList

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

.all(project_id, complete = nil) ⇒ Object

Returns all lists for a project. If complete is true, only completed lists are returned. If complete is false, only uncompleted lists are returned.



302
303
304
305
306
307
308
309
310
311
# File 'lib/basecamp/basecamp.rb', line 302

def self.all(project_id, complete = nil)
  filter = case complete
           when nil   then "all"
           when true  then "finished"
           when false then "pending"
           else raise ArgumentError, "invalid value for `complete'"
           end

  find(:all, :params => { :project_id => project_id, :filter => filter })
end

Instance Method Details

#todo_items(options = {}) ⇒ Object



313
314
315
# File 'lib/basecamp/basecamp.rb', line 313

def todo_items(options = {})
  @todo_items ||= TodoItem.find(:all, :params => options.merge(:todo_list_id => id))
end