lib/pricesphere/product.rb in pricesphere-0.2.2 vs lib/pricesphere/product.rb in pricesphere-0.2.3
- old
+ new
@@ -1,19 +1,19 @@
module Pricesphere
class Product < Base
def search(term = '')
return {} if term == ''
- with_attributes( search: term )
+ with_attributes( { :search => term } )
end
def with_attributes(attributes = {})
return {} if attributes == {}
page = 1
last_page = false
Enumerator.new do |yielder|
loop do
raise StopIteration if last_page
- result = get(attributes.merge(page: page))
+ result = get(attributes.merge({:page => page}))
if page == result['meta']['pages'].to_i
last_page = true
end
page += 1
\ No newline at end of file