Class: BatchBook::Todo
- Defined in:
- lib/batchbook.rb
Instance Method Summary collapse
- #add_related_contact(contact_id) ⇒ Object
- #add_tag(name) ⇒ Object
- #comment(id) ⇒ Object
- #comments(scope = :all) ⇒ Object
- #remove_related_contact(contact_id) ⇒ Object
- #remove_tag(name) ⇒ Object
- #tags ⇒ Object
Methods inherited from Base
Instance Method Details
#add_related_contact(contact_id) ⇒ Object
270 271 272 273 |
# File 'lib/batchbook.rb', line 270 def (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
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 |
#remove_related_contact(contact_id) ⇒ Object
275 276 277 278 |
# File 'lib/batchbook.rb', line 275 def (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
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 |
#tags ⇒ Object
248 249 250 |
# File 'lib/batchbook.rb', line 248 def Tag.find(:all, :params => {:todo_id => id}) end |