Class: Sapphire::HTTPartyReddit
- Inherits:
-
Object
- Object
- Sapphire::HTTPartyReddit
- Includes:
- HTTParty
- Defined in:
- lib/apiclients/httparty.rb
Instance Method Summary collapse
- #get_posts(subreddit) ⇒ Object
-
#initialize ⇒ HTTPartyReddit
constructor
A new instance of HTTPartyReddit.
Constructor Details
#initialize ⇒ HTTPartyReddit
Returns a new instance of HTTPartyReddit.
7 8 9 |
# File 'lib/apiclients/httparty.rb', line 7 def initialize @options = { query: { limit: 10, sort: 'hot' } } end |
Instance Method Details
#get_posts(subreddit) ⇒ Object
11 12 13 14 |
# File 'lib/apiclients/httparty.rb', line 11 def get_posts(subreddit) response = self.class.get("/r/#{subreddit}/hot.json", @options) parse_response(response) end |