Class: BatchBook::Communication

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

Instance Method Summary collapse

Methods inherited from Base

inherited

Instance Method Details

#add_tag(name) ⇒ Object

Raises:



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

Raises:



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

#tagsObject



347
348
349
# File 'lib/batchbook.rb', line 347

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