def parse(data)
      items = []

      data["on_sale"].each do |item|
        sale_item = SaleItem.new(get_title(item), get_current_price(item),
          get_original_price(item), get_discount_percentage(item),
          get_discount_amount(item))

        if @type.nil?
          items.push(sale_item)
        else
          if (@type == "games" && is_game?(item))
            items.push(sale_item)
          end

          if (@type == "movies" && is_movie?(item))
            items.push(sale_item)
          end
        end
      end

      unless @limit.nil?
        items.take(@limit)
      else
        items
      end
    end
def parse(data)
      items = []

      data["on_sale"].each do |item|
        sale_item = SaleItem.new(get_title(item), get_current_price(item),
          get_original_price(item), get_discount_percentage(item),
          get_discount_amount(item))

        if @type.nil?
          items.push(sale_item)
        else
          if (@type == "games" && is_game?(item))
            items.push(sale_item)
          end

          if (@type == "movies" && is_movie?(item))
            items.push(sale_item)
          end
        end
      end

      unless @limit.nil?
        items.take(@limit)
      else
        items
      end
    end
Parses raw data and returns sale items.

 @return [Array]