lib/loquor/api_calls/index.rb in loquor-0.1.1 vs lib/loquor/api_calls/index.rb in loquor-0.1.2
- old
+ new
@@ -26,20 +26,20 @@
per = 200
results = []
begin
results = Loquor.get("#{generate_url}&page=#{page}&per=#{per}")
results.each do |result|
- yield result
+ yield Representation.new(result)
end
page += 1
end while(results.size == per)
end
private
def results
if @results.nil?
- @results = Loquor.get(generate_url)
+ @results = Loquor.get(generate_url).map {|obj| Representation.new(obj)}
end
@results
end
def generate_url