Module: BookingSync::API::Client::Contacts
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/contacts.rb
Instance Method Summary collapse
-
#contact(contact, options = {}) ⇒ BookingSync::API::Resource
Get a single contact.
-
#contacts(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List contacts.
-
#create_contact(options = {}) ⇒ BookingSync::API::Resource
Create a new contact.
-
#delete_contact(contact) ⇒ NilClass
Delete a contact.
-
#edit_contact(contact, options = {}) ⇒ BookingSync::API::Resource
Edit a contact.
Instance Method Details
#contact(contact, options = {}) ⇒ BookingSync::API::Resource
Get a single contact
28 29 30 |
# File 'lib/bookingsync/api/client/contacts.rb', line 28 def contact(contact, = {}) get("contacts/#{contact}", ).pop end |
#contacts(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List contacts
Returns contacts for the account user is authenticated with.
17 18 19 |
# File 'lib/bookingsync/api/client/contacts.rb', line 17 def contacts( = {}, &block) paginate :contacts, , &block end |
#create_contact(options = {}) ⇒ BookingSync::API::Resource
Create a new contact
36 37 38 |
# File 'lib/bookingsync/api/client/contacts.rb', line 36 def create_contact( = {}) post(:contacts, contacts: []).pop end |
#delete_contact(contact) ⇒ NilClass
Delete a contact
58 59 60 |
# File 'lib/bookingsync/api/client/contacts.rb', line 58 def delete_contact(contact) delete "contacts/#{contact}" end |
#edit_contact(contact, options = {}) ⇒ BookingSync::API::Resource
Edit a contact
49 50 51 |
# File 'lib/bookingsync/api/client/contacts.rb', line 49 def edit_contact(contact, = {}) put("contacts/#{contact}", contacts: []).pop end |