Class: Gista::ApiRequest
- Inherits:
-
Object
- Object
- Gista::ApiRequest
- Defined in:
- lib/gista/api_request.rb
Overview
Base class for JSON requests to the Github API. ApiRequest knows how to send
a request with a JSON body and parse the results. Use fetch
to read values
from the JSON response.
Raises an exception when not authorized or when the API request responds with something other than an OK.
Direct Known Subclasses
Constant Summary collapse
- URL =
'api.github.com'
- PORT =
443
- OPEN_TIMEOUT =
10
- READ_TIMEOUT =
10
- CONTENT_TYPE =
'application/json'
Instance Method Summary collapse
-
#fetch(key) ⇒ Object
Read a key from the response.
Instance Method Details
#fetch(key) ⇒ Object
Read a key from the response.
20 21 22 |
# File 'lib/gista/api_request.rb', line 20 def fetch(key) result.fetch(key) end |