Module: PatchRetention::Contacts::Find
Overview
The PatchRetention::Contacts::Find module provides methods to find contacts in the PatchRetention system. It includes methods to find a contact by ID and to retrieve all contacts with pagination.
Instance Method Summary collapse
-
#all(limit:, offset:, email: nil, config: nil) ⇒ Object
Retrieves all contacts with pagination.
-
#by_id(id, config = nil) ⇒ Object
Finds a contact by its ID.
Methods included from Util
#parse_error_message, #raise_error_if_present
Instance Method Details
#all(limit:, offset:, email: nil, config: nil) ⇒ Object
Retrieves all contacts with pagination.
36 37 38 39 40 41 42 43 44 |
# File 'lib/patch_retention/contacts/find.rb', line 36 def all(limit:, offset:, email: nil, config: nil) raise_error_if_present do PatchRetention.connection(config).get(PatchRetention::Contacts::API_PATH) do |req| req.params["limit"] = limit req.params["offset"] = offset req.params["email"] = email if email end end end |
#by_id(id, config = nil) ⇒ Object
Finds a contact by its ID.
22 23 24 25 26 |
# File 'lib/patch_retention/contacts/find.rb', line 22 def by_id(id, config = nil) raise_error_if_present do PatchRetention.connection(config).get("#{PatchRetention::Contacts::API_PATH}/#{id}") end end |