Class: SimplyReddit::Subreddit
- Inherits:
-
Object
- Object
- SimplyReddit::Subreddit
- Defined in:
- lib/simply_reddit/subreddit.rb
Instance Method Summary collapse
- #about ⇒ Object
- #hot(limit: 25) ⇒ Object
-
#initialize(client:, name:) ⇒ Subreddit
constructor
A new instance of Subreddit.
- #new(limit: 25) ⇒ Object
- #rising(limit: 25) ⇒ Object
- #top(limit: 25, t: 'day') ⇒ Object
Constructor Details
#initialize(client:, name:) ⇒ Subreddit
Returns a new instance of Subreddit.
2 3 4 5 |
# File 'lib/simply_reddit/subreddit.rb', line 2 def initialize(client:, name:) @client = client @name = name end |
Instance Method Details
#about ⇒ Object
23 24 25 |
# File 'lib/simply_reddit/subreddit.rb', line 23 def about @client.get("/r/#{@name}/about") end |
#hot(limit: 25) ⇒ Object
7 8 9 |
# File 'lib/simply_reddit/subreddit.rb', line 7 def hot(limit: 25) @client.get("/r/#{@name}/hot", limit: limit) end |
#new(limit: 25) ⇒ Object
11 12 13 |
# File 'lib/simply_reddit/subreddit.rb', line 11 def new(limit: 25) @client.get("/r/#{@name}/new", limit: limit) end |
#rising(limit: 25) ⇒ Object
19 20 21 |
# File 'lib/simply_reddit/subreddit.rb', line 19 def rising(limit: 25) @client.get("/r/#{@name}/rising", limit: limit) end |
#top(limit: 25, t: 'day') ⇒ Object
15 16 17 |
# File 'lib/simply_reddit/subreddit.rb', line 15 def top(limit: 25, t: 'day') @client.get("/r/#{@name}/top", limit: limit, t: t) end |