Class: KlaviyoAPI::List
- Defined in:
- lib/klaviyo_api/resources/list.rb
Class Method Summary collapse
-
.find_single(scope, options) ⇒ Object
Override this from ActiveResource#base in order to inject the id into the response because it’s not returned.
Instance Method Summary collapse
-
#members(options = {}) ⇒ Object
Gets all Members of this List.
Methods inherited from Base
activate_session, element_path, headers, reset_session, #to_h
Class Method Details
.find_single(scope, options) ⇒ Object
Override this from ActiveResource#base in order to inject the id into the response because it’s not returned
13 14 15 |
# File 'lib/klaviyo_api/resources/list.rb', line 13 def find_single(scope, ) super.tap { |record| record.id = scope } end |
Instance Method Details
#members(options = {}) ⇒ Object
Gets all Members of this List. Uses the Groups endpoint. Returns an enumerator that knows how to transparently deal with Klaviyo’s ‘marker` for pagination. Pages seem to be 1000 items.
24 25 26 |
# File 'lib/klaviyo_api/resources/list.rb', line 24 def members( = {}) KlaviyoAPI::ListMember.all_members params: { list_id: id, ** } end |