Class: CustomerioAPI::CustomerResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/customerio_api/resources/customer_resource.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#get_request, #handle_response, #initialize, #post_request, #put_request

Constructor Details

This class inherits a constructor from CustomerioAPI::Resource

Instance Method Details

#where(email:) ⇒ Object

client.customer.where(email: “[email protected]”) Response:

#<CustomerioAPI::Customer email=“[email protected]”, id=“test1”, cio_id=“d7a90a000102”>


9
10
11
12
# File 'lib/customerio_api/resources/customer_resource.rb', line 9

def where(email:)
  response_body = get_request('customers', params: { email: email }).body
  response_body['results'].map { |customers| Customer.new(customers) }
end