Class: HnApi::Client
- Inherits:
-
Object
- Object
- HnApi::Client
- Defined in:
- lib/hn-api/client.rb
Constant Summary collapse
- URI =
Base URI for the HN API
"http://api.ihackernews.com/"
Instance Method Summary collapse
-
#latest ⇒ Object
Retrieve the latest posts from HN API, and transform into an object-like response with Hashie.
Instance Method Details
#latest ⇒ Object
Retrieve the latest posts from HN API, and transform into an object-like response with Hashie.
8 9 10 11 |
# File 'lib/hn-api/client.rb', line 8 def latest content = connection.get("/page").body Hashie::Mash.new(content) end |