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