Class: BatchBook::Todo

Inherits:
Base
  • Object
show all
Defined in:
lib/batchbook.rb

Instance Method Summary collapse

Methods inherited from Base

inherited

Instance Method Details

Raises:



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

def add_related_contact(contact_id)
  raise Error, "Contact not specified.  Usage: deal.add_contact(50)" unless contact_id
  self.put(:add_related_contact, :contact_id => contact_id)
end

#add_tag(name) ⇒ Object

Raises:



252
253
254
255
# File 'lib/batchbook.rb', line 252

def add_tag name
  raise Error, "Tag name not specified.  Usage:  todo.add_tag('tag_name')" unless name
  self.put(:add_tag, :tag => name)
end

#comment(id) ⇒ Object



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

def comment(id)
  comments(id)
end

#comments(scope = :all) ⇒ Object



262
263
264
# File 'lib/batchbook.rb', line 262

def comments(scope = :all)
  Comment.find(scope, :params => {:todo_id => self.id})
end

Raises:



275
276
277
278
# File 'lib/batchbook.rb', line 275

def remove_related_contact(contact_id)
  raise Error, "Contact not specified.  Usage: deal.add_contact(50)" unless contact_id
  self.delete(:remove_related_contact, :contact_id => contact_id)
end

#remove_tag(name) ⇒ Object

Raises:



257
258
259
260
# File 'lib/batchbook.rb', line 257

def remove_tag name
  raise Error, "Tag name not specified.  Usage:  todo.remove_tag('tag_name')" unless name
  self.delete(:remove_tag, :tag => name)
end

#tagsObject



248
249
250
# File 'lib/batchbook.rb', line 248

def tags
  Tag.find(:all, :params => {:todo_id => id})
end