Class: Highrise::Subject

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

Direct Known Subclasses

Company, Deal, Kase, Person

Instance Method Summary collapse

Instance Method Details

#add_note(attrs = {}) ⇒ Object



7
8
9
10
11
# File 'lib/highrise/subject.rb', line 7

def add_note(attrs={})
  attrs[:subject_id] = self.id
  attrs[:subject_type] = self.label
  Note.create attrs
end

#emailsObject



13
14
15
# File 'lib/highrise/subject.rb', line 13

def emails
  Email.find_all_across_pages(:from => "/#{self.class.collection_name}/#{id}/emails.xml")
end

#labelObject



21
22
23
# File 'lib/highrise/subject.rb', line 21

def label
  self.class.name.split('::').last
end

#notesObject



3
4
5
# File 'lib/highrise/subject.rb', line 3

def notes
  Note.find_all_across_pages(:from => "/#{self.class.collection_name}/#{id}/notes.xml")
end

#upcoming_tasksObject



17
18
19
# File 'lib/highrise/subject.rb', line 17

def upcoming_tasks
  Task.find(:all, :from => "/#{self.class.collection_name}/#{id}/tasks.xml")
end