Class: ReamazeAPI::Contact
- Defined in:
- lib/reamaze_api/contact.rb
Instance Method Summary collapse
-
#all(params = {}) ⇒ Object
Public: Retrieve contacts.
-
#create(params) ⇒ Object
Public: Create a new contact.
-
#update(slug, params) ⇒ Object
Public: Update an existing contact.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from ReamazeAPI::Resource
Instance Method Details
#all(params = {}) ⇒ Object
Public: Retrieve contacts.
params - Hash of parameters to pass to the API
API Routes
GET /contacts
See also: www.reamaze.com/api/get_contacts
Returns a Hash.
14 15 16 |
# File 'lib/reamaze_api/contact.rb', line 14 def all(params = {}) paginate "/contacts", :contacts, params end |
#create(params) ⇒ Object
Public: Create a new contact.
params - Hash of parameters to pass to the API
API Routes
POST /contacts
See also: www.reamaze.com/api/post_contacts
Returns a Hash.
29 30 31 |
# File 'lib/reamaze_api/contact.rb', line 29 def create(params) post "/contacts", params end |
#update(slug, params) ⇒ Object
Public: Update an existing contact.
slug - Contact slug (email) params - Hash of parameters to pass to the API
API Routes
PUT /contacts/{slug}
See also: www.reamaze.com/api/put_contacts
Returns a Hash.
45 46 47 |
# File 'lib/reamaze_api/contact.rb', line 45 def update(slug, params) put "/contacts/#{slug}", params end |