class Contactually::Buckets
Public Class Methods
new(master)
click to toggle source
# File lib/contactually/buckets.rb, line 3 def initialize(master) @master = master end
Public Instance Methods
contacts(id, params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 35 def contacts(id, params = {}) hash = @master.call("buckets/#{id}/contacts.json", :get, params) Contactually::Utils.contacts_hash_to_objects(hash) end
count(params = { limit: 1 })
click to toggle source
# File lib/contactually/buckets.rb, line 45 def count(params = { limit: 1 }) @master.call('buckets.json', :get, params)["meta"]["total"] end
create(params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 7 def create(params = {}) hash = @master.call('buckets.json', :post, params) Contactually::Utils.build_bucket(hash) end
destroy(id, params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 12 def destroy(id, params = {}) @master.call("buckets/#{id}.json", :delete, {}) end
destroy_multiple(params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 16 def destroy_multiple(params = {}) @master.call('buckets.json', :delete, params) end
index(params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 30 def index(params = {}) hash = @master.call('buckets.json', :get, params) Contactually::Utils.buckets_hash_to_objects(hash) end
search(params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 40 def search(params = {}) hash = @master.call('buckets/search.json', :get, params) Contactually::Utils.buckets_hash_to_objects(hash) end
show(id, params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 20 def show(id, params = {}) hash = @master.call("buckets/#{id}.json", :get, params) Contactually::Utils.build_bucket(hash) end
update(id, params = {})
click to toggle source
# File lib/contactually/buckets.rb, line 25 def update(id, params = {}) hash = @master.call("buckets/#{id}.json", :put, params) Contactually::Utils.build_bucket(hash); end