class EcwidApi::UnpagedEcwidResponse
Public Class Methods
new(client, path, params = {}, &block)
click to toggle source
Public: Initialize a new UnpagedEcwidResponse
client - an EcwidApi::Client
path - a String
that is the path to retrieve from the client params - a Hash of parameters to pass along with the request &block - a Block that processes each item returned in the Response
# File lib/ecwid_api/unpaged_ecwid_response.rb, line 28 def initialize(client, path, params = {}, &block) block ||= Proc.new { |item| item } @records = [] response = client.get(path, params) response.body.each do |item| @records << block.call(item) end end