Class: RedditApi::Subreddits
- Inherits:
-
Object
- Object
- RedditApi::Subreddits
- Defined in:
- lib/reddit_api/subreddits.rb
Instance Method Summary collapse
- #data_for(subreddit_name) ⇒ Object
-
#initialize ⇒ Subreddits
constructor
A new instance of Subreddits.
- #top(count) ⇒ Object
Constructor Details
Instance Method Details
#data_for(subreddit_name) ⇒ Object
16 17 18 19 20 |
# File 'lib/reddit_api/subreddits.rb', line 16 def data_for(subreddit_name) query = build_singular_query(subreddit_name) client.get(query) build_subreddit(query.captured_records.first) end |
#top(count) ⇒ Object
11 12 13 14 |
# File 'lib/reddit_api/subreddits.rb', line 11 def top(count) subreddits_data = top_data(count) build_all_subreddits(subreddits_data) end |