lib/rsqoot/deal.rb in rsqoot-0.4.2 vs lib/rsqoot/deal.rb in rsqoot-0.5.0

- old
+ new

@@ -10,11 +10,11 @@ # def deals(options={}) options = update_by_expire_time options if deals_not_latest?(options) uniq = !!options.delete(:uniq) - @rsqoot_deals = get('deals', options) || [] + @rsqoot_deals = get('deals', options, SqootDeal) || [] @rsqoot_deals = @rsqoot_deals.deals.map(&:deal) if !@rsqoot_deals.empty? @rsqoot_deals = uniq_deals(@rsqoot_deals) if uniq end @rsqoot_deals end @@ -22,10 +22,10 @@ # Retrieve a deal by id # def deal(id, options={}) options = update_by_expire_time options if deal_not_latest?(id) - @rsqoot_deal = get("deals/#{id}", options) + @rsqoot_deal = get("deals/#{id}", options, SqootDeal) @rsqoot_deal = @rsqoot_deal.deal if @rsqoot_deal end @rsqoot_deal end \ No newline at end of file