Class: ReamazeAPI::Contact

Inherits:
Resource show all
Defined in:
lib/reamaze_api/contact.rb

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from ReamazeAPI::Resource

Instance Method Details

#all(params = {}) ⇒ Object

Retrieve contacts.

Parameters:

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

Create a new contact.

Parameters:

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

Update an existing contact.

Parameters:

  • slug

    Contact slug (email)

  • params

    Hash of parameters to pass to the API

  • API

    Routes PUT /contacts/slug

  • See

Returns:

  • a Hash.



45
46
47
# File 'lib/reamaze_api/contact.rb', line 45

def update(slug, params)
  put "/contacts/#{slug}", params
end