Class: Contactually::Notes
- Inherits:
-
Object
- Object
- Contactually::Notes
- Defined in:
- lib/contactually/notes.rb
Instance Method Summary collapse
- #create(params = {}) ⇒ Object
- #destroy(id, params = {}) ⇒ Object
- #index(params = {}) ⇒ Object
-
#initialize(master) ⇒ Notes
constructor
A new instance of Notes.
- #show(id, params = {}) ⇒ Object
- #update(id, params = {}) ⇒ Object
Constructor Details
#initialize(master) ⇒ Notes
Returns a new instance of Notes.
3 4 5 |
# File 'lib/contactually/notes.rb', line 3 def initialize(master) @master = master end |
Instance Method Details
#create(params = {}) ⇒ Object
17 18 19 20 |
# File 'lib/contactually/notes.rb', line 17 def create(params = {}) hash = @master.call('notes.json', :post, params) Contactually::Utils.build_note(hash) end |
#destroy(id, params = {}) ⇒ Object
22 23 24 |
# File 'lib/contactually/notes.rb', line 22 def destroy(id, params = {}) @master.call("notes/#{id}.json", :delete, params) end |
#index(params = {}) ⇒ Object
7 8 9 10 |
# File 'lib/contactually/notes.rb', line 7 def index(params = {}) hash = @master.call('notes.json', :get, params) Contactually::Utils.notes_hash_to_objects(hash) end |
#show(id, params = {}) ⇒ Object
12 13 14 15 |
# File 'lib/contactually/notes.rb', line 12 def show(id, params = {}) hash = @master.call("notes/#{id}.json", :get, params) Contactually::Utils.build_note(hash) end |
#update(id, params = {}) ⇒ Object
26 27 28 29 |
# File 'lib/contactually/notes.rb', line 26 def update(id, params = {}) hash = @master.call("notes/#{id}.json", :put, params) Contactually::Utils.build_note(hash) end |