Class: NeonRAW::Objects::All

Inherits:
Object
  • Object
show all
Defined in:
lib/NeonRAW/objects/all.rb

Overview

The object for /r/all.

Listings collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ All

Returns a new instance of All.



5
6
7
# File 'lib/NeonRAW/objects/all.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#comments(param = { limit: 25 }) ⇒ NeonRAW::Objects::Listing

Fetches a listing from /r/all.

Parameters:

  • params (Hash)

    The parameters for the request.

Returns:



28
29
30
31
32
33
# File 'lib/NeonRAW/objects/all.rb', line 28

%w(hot rising top old new controversial comments).each do |type|
  define_method :"#{type}" do |params = { limit: 25 }|
    path = "/r/all/#{type}/.json"
    @client.send(:build_listing, path, params)
  end
end

#controversial(params = { limit: 25 }) ⇒ NeonRAW::Objects::Listing

Fetches a listing from /r/all.

Parameters:

  • params (Hash) (defaults to: { limit: 25 })

    The parameters for the request.

Options Hash (params):

  • :t (String)

    Time for relevant sorting [hour, day, week, month, year, all]

  • :after (String)

    The name of the next data block.

  • :before (String)

    The name of the previous data block.

  • :count (Integer)

    The number of items already in the listing.

  • :limit (1..1000)

    The number of items to fetch.

  • :show (String)

    Literally the string ‘all’.

Returns:



28
29
30
31
32
33
# File 'lib/NeonRAW/objects/all.rb', line 28

%w(hot rising top old new controversial comments).each do |type|
  define_method :"#{type}" do |params = { limit: 25 }|
    path = "/r/all/#{type}/.json"
    @client.send(:build_listing, path, params)
  end
end

#hot(params = { limit: 25 }) ⇒ NeonRAW::Objects::Listing

Fetches a listing from /r/all.

Parameters:

  • params (Hash) (defaults to: { limit: 25 })

    The parameters for the request.

Options Hash (params):

  • :t (String)

    Time for relevant sorting [hour, day, week, month, year, all]

  • :after (String)

    The name of the next data block.

  • :before (String)

    The name of the previous data block.

  • :count (Integer)

    The number of items already in the listing.

  • :limit (1..1000)

    The number of items to fetch.

  • :show (String)

    Literally the string ‘all’.

Returns:



28
29
30
31
32
33
# File 'lib/NeonRAW/objects/all.rb', line 28

%w(hot rising top old new controversial comments).each do |type|
  define_method :"#{type}" do |params = { limit: 25 }|
    path = "/r/all/#{type}/.json"
    @client.send(:build_listing, path, params)
  end
end

#new(params = { limit: 25 }) ⇒ NeonRAW::Objects::Listing

Fetches a listing from /r/all.

Parameters:

  • params (Hash) (defaults to: { limit: 25 })

    The parameters for the request.

Options Hash (params):

  • :t (String)

    Time for relevant sorting [hour, day, week, month, year, all]

  • :after (String)

    The name of the next data block.

  • :before (String)

    The name of the previous data block.

  • :count (Integer)

    The number of items already in the listing.

  • :limit (1..1000)

    The number of items to fetch.

  • :show (String)

    Literally the string ‘all’.

Returns:



28
29
30
31
32
33
# File 'lib/NeonRAW/objects/all.rb', line 28

%w(hot rising top old new controversial comments).each do |type|
  define_method :"#{type}" do |params = { limit: 25 }|
    path = "/r/all/#{type}/.json"
    @client.send(:build_listing, path, params)
  end
end

#old(params = { limit: 25 }) ⇒ NeonRAW::Objects::Listing

Fetches a listing from /r/all.

Parameters:

  • params (Hash) (defaults to: { limit: 25 })

    The parameters for the request.

Options Hash (params):

  • :t (String)

    Time for relevant sorting [hour, day, week, month, year, all]

  • :after (String)

    The name of the next data block.

  • :before (String)

    The name of the previous data block.

  • :count (Integer)

    The number of items already in the listing.

  • :limit (1..1000)

    The number of items to fetch.

  • :show (String)

    Literally the string ‘all’.

Returns:



28
29
30
31
32
33
# File 'lib/NeonRAW/objects/all.rb', line 28

%w(hot rising top old new controversial comments).each do |type|
  define_method :"#{type}" do |params = { limit: 25 }|
    path = "/r/all/#{type}/.json"
    @client.send(:build_listing, path, params)
  end
end

#rising(params = { limit: 25 }) ⇒ NeonRAW::Objects::Listing

Fetches a listing from /r/all.

Parameters:

  • params (Hash) (defaults to: { limit: 25 })

    The parameters for the request.

Options Hash (params):

  • :t (String)

    Time for relevant sorting [hour, day, week, month, year, all]

  • :after (String)

    The name of the next data block.

  • :before (String)

    The name of the previous data block.

  • :count (Integer)

    The number of items already in the listing.

  • :limit (1..1000)

    The number of items to fetch.

  • :show (String)

    Literally the string ‘all’.

Returns:



28
29
30
31
32
33
# File 'lib/NeonRAW/objects/all.rb', line 28

%w(hot rising top old new controversial comments).each do |type|
  define_method :"#{type}" do |params = { limit: 25 }|
    path = "/r/all/#{type}/.json"
    @client.send(:build_listing, path, params)
  end
end

#top(params = { limit: 25 }) ⇒ NeonRAW::Objects::Listing

Fetches a listing from /r/all.

Parameters:

  • params (Hash) (defaults to: { limit: 25 })

    The parameters for the request.

Options Hash (params):

  • :t (String)

    Time for relevant sorting [hour, day, week, month, year, all]

  • :after (String)

    The name of the next data block.

  • :before (String)

    The name of the previous data block.

  • :count (Integer)

    The number of items already in the listing.

  • :limit (1..1000)

    The number of items to fetch.

  • :show (String)

    Literally the string ‘all’.

Returns:



28
29
30
31
32
33
# File 'lib/NeonRAW/objects/all.rb', line 28

%w(hot rising top old new controversial comments).each do |type|
  define_method :"#{type}" do |params = { limit: 25 }|
    path = "/r/all/#{type}/.json"
    @client.send(:build_listing, path, params)
  end
end