def top(options = {}, &block)
      params = {}

      if options[:game]
        params[:game] = options[:game]
      end

      period = options[:period] || :week
      if ![:week, :month, :all].include?(period)
        raise ArgumentError, 'period'
      end

      params[:period] = period.to_s

      return @query.connection.accumulate(
        :path => 'videos/top',
        :params => params,
        :json => 'videos',
        :create => -> hash { Video.new(hash, @query) },
        :limit => options[:limit],
        :offset => options[:offset],
        &block
      )
    end
def top(options = {}, &block)
      params = {}

      if options[:game]
        params[:game] = options[:game]
      end

      period = options[:period] || :week
      if ![:week, :month, :all].include?(period)
        raise ArgumentError, 'period'
      end

      params[:period] = period.to_s

      return @query.connection.accumulate(
        :path => 'videos/top',
        :params => params,
        :json => 'videos',
        :create => -> hash { Video.new(hash, @query) },
        :limit => options[:limit],
        :offset => options[:offset],
        &block
      )
    end
Get the list of most popular videos based on view count.
 @note The number of videos returned is potentially very large, so it's recommended that you specify a `:limit`.
 @example
   Twitch.videos.top
 @example
   Twitch.videos.top(:period => :month, :game => 'Super Meat Boy')
 @example
   Twitch.videos.top(:period => :all, :limit => 10)
 @example
   Twitch.videos.top(:period => :all) do |video|
     next if video.view_count < 10000
     puts video.url
   end
 @param options [Hash] Filter criteria.
 @option options [Symbol] :period (:week) Return videos only in this time period. Valid values are `:week`, `:month`, `:all`.
 @option options [String] :game (nil) Return videos only for this game.
 @option options [Fixnum] :limit (nil) Limit on the number of results returned.
 @option options [Fixnum] :offset (0) Offset into the result set to begin enumeration.
 @yield Optional. If a block is given, each top video is yielded.
 @yieldparam [Video] video Current video.
 @see https://github.com/justintv/Twitch-API/blob/master/v2_resources/videos.md#get-videostop GET /videos/top
 @raise [ArgumentError] If `:period` is not one of `:week`, `:month`, or `:all`.
 @return [Array<Video>] Top videos, if no block is given.
 @return [nil] If a block is given.