Class: RedditApi::Posts
- Inherits:
-
Object
- Object
- RedditApi::Posts
- Defined in:
- lib/reddit_api/posts.rb
Instance Method Summary collapse
-
#initialize ⇒ Posts
constructor
A new instance of Posts.
- #top(subreddit, count) ⇒ Object
Constructor Details
#initialize ⇒ Posts
Returns a new instance of Posts.
5 6 7 8 |
# File 'lib/reddit_api/posts.rb', line 5 def initialize @client = RedditApi::Client.new @post_factory = RedditApi::Post end |
Instance Method Details
#top(subreddit, count) ⇒ Object
10 11 12 13 14 |
# File 'lib/reddit_api/posts.rb', line 10 def top(subreddit, count) posts_data = top_data(subreddit, count) posts_data = filter_out(posts_data, :stickied_posts) build_all_posts(posts_data) end |