class NeonRAW::Objects::Popular

The object for /r/popular.

Public Class Methods

new(client) click to toggle source

@!method initialize(client) @param client [NeonRAW::Clients::Web/Installed/Script] The client

object.
# File lib/NeonRAW/objects/popular.rb, line 8
def initialize(client)
  @client = client
end

Public Instance Methods

stream(queue, params = { limit: 25 }) click to toggle source

Streams content from /r/popular. @!method stream(queue, params = { limit: 25 }) @param queue [Symbol] The queue to get data from [hot, top, new,

controversial, gilded, comments]

@param params [Hash] The parameters for the request. @option params :t [String] Time for relevant sorting [hour, day, week,

month, year, all]

@option params :after [String] The name of the next data block. @option params :before [String] The name of the previous data block. @option params :count [Integer] The number of items already in the

listing.

@option params :limit [1..1000] The number of items to fetch. @option params :show [String] Literally the string 'all'. @return [Enumerator] Returns an enumerator for the streamed data.

# File lib/NeonRAW/objects/popular.rb, line 52
def stream(queue, params = { limit: 25 })
  @client.send(:stream, "/r/popular/#{queue}", params)
end