Sha256: d10cdacc104ba018dc481de45eb2f071368942b42e14751281dfe93b004df0e9
Contents?: true
Size: 630 Bytes
Versions: 19
Compression:
Stored size: 630 Bytes
Contents
module Snov class GetAllProspectsFromList include Enumerable attr_reader :client, :list_id, :max, :per_page def initialize(list_id:, max: 9999, per_page: 100, client: Snov.client) @client = client @list_id = list_id @max = max.to_int @per_page = per_page end def each(&block) (1..max).each do |page| list = GetProspectList.new(list_id: list_id, page: page, per_page: per_page, client: client) prospects = list.prospects prospects.each(&block) break if prospects.size < per_page end end end end
Version data entries
19 entries across 19 versions & 1 rubygems