Class: KlaviyoAPI::List

Inherits:
Base
  • Object
show all
Defined in:
lib/klaviyo_api/resources/list.rb

Class Method Summary collapse

Instance Method Summary collapse

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, options)
  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.

www.klaviyo.com/docs/api/v2/lists#get-members-all



24
25
26
# File 'lib/klaviyo_api/resources/list.rb', line 24

def members(options = {})
  KlaviyoAPI::ListMember.all_members params: { list_id: id, **options }
end