Class: RubyRedtail::Notes

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-redtail/contact/notes.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_hash) ⇒ Notes

Returns a new instance of Notes.



3
4
5
# File 'lib/ruby-redtail/contact/notes.rb', line 3

def initialize (api_hash)
  @api_hash = api_hash
end

Instance Method Details

#create(contact_id, params) ⇒ Object

Create New Note



18
19
20
# File 'lib/ruby-redtail/contact/notes.rb', line 18

def create (contact_id, params)
  update(contact_id, 0, params)
end

#fetch(contact_id, page = 1) ⇒ Object

Fetch Notes By Contact Id



8
9
10
# File 'lib/ruby-redtail/contact/notes.rb', line 8

def fetch (contact_id, page = 1)
  RubyRedtail::Query.run("contacts/#{contact_id}/notes?page=#{page}", @api_hash, "GET")
end

#recentObject

Fetch Recently Added Notes



23
24
25
# File 'lib/ruby-redtail/contact/notes.rb', line 23

def recent
  RubyRedtail::Query.run("contacts/notes/recent", @api_hash, 'GET')
end

#update(contact_id, note_id, params) ⇒ Object

Update Note



13
14
15
# File 'lib/ruby-redtail/contact/notes.rb', line 13

def update (contact_id, note_id, params)
  RubyRedtail::Query.run("contacts/#{contact_id}/notes/#{note_id}", @api_hash, 'PUT', params)
end