Class: Pennyworth::Integrations::GitHub::Response
- Inherits:
-
Object
- Object
- Pennyworth::Integrations::GitHub::Response
- Defined in:
- lib/pennyworth/integrations/git_hub/response.rb
Overview
Represents a generic GitHub API response.
Instance Method Summary collapse
-
#initialize(raw) ⇒ Response
constructor
A new instance of Response.
- #last_page ⇒ Object
- #next_page ⇒ Object
- #records ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(raw) ⇒ Response
Returns a new instance of Response.
8 9 10 |
# File 'lib/pennyworth/integrations/git_hub/response.rb', line 8 def initialize raw @raw = raw end |
Instance Method Details
#last_page ⇒ Object
14 |
# File 'lib/pennyworth/integrations/git_hub/response.rb', line 14 def last_page = page("last") |
#next_page ⇒ Object
12 |
# File 'lib/pennyworth/integrations/git_hub/response.rb', line 12 def next_page = page("next") |
#records ⇒ Object
16 |
# File 'lib/pennyworth/integrations/git_hub/response.rb', line 16 def records = success? ? JSON(raw.body, symbolize_names: true) : [] |
#success? ⇒ Boolean
18 |
# File 'lib/pennyworth/integrations/git_hub/response.rb', line 18 def success? = raw.status.success? |