Class: BatchBook::Communication
- Defined in:
- lib/batchbook.rb
Instance Method Summary collapse
- #add_tag(name) ⇒ Object
- #comment(id) ⇒ Object
- #comments(scope = :all) ⇒ Object
- #remove_tag(name) ⇒ Object
- #tags ⇒ Object
Methods inherited from Base
Instance Method Details
#add_tag(name) ⇒ Object
351 352 353 354 |
# File 'lib/batchbook.rb', line 351 def add_tag name raise Error, "Tag name not specified. Usage: communication.add_tag('tag_name')" unless name self.put(:add_tag, :tag => name) end |
#comment(id) ⇒ Object
365 366 367 |
# File 'lib/batchbook.rb', line 365 def comment(id) comments(id) end |
#comments(scope = :all) ⇒ Object
361 362 363 |
# File 'lib/batchbook.rb', line 361 def comments(scope = :all) Comment.find(scope, :params => {:communication_id => self.id}) end |
#remove_tag(name) ⇒ Object
356 357 358 359 |
# File 'lib/batchbook.rb', line 356 def remove_tag name raise Error, "Tag name not specified. Usage: communication.remove_tag('tag_name')" unless name self.delete(:remove_tag, :tag => name) end |
#tags ⇒ Object
347 348 349 |
# File 'lib/batchbook.rb', line 347 def Tag.find(:all, :params => {:communication_id => id}) end |