Class: HTTPResponse
- Inherits:
-
Object
- Object
- HTTPResponse
- Defined in:
- lib/gitlab-burndown/net/http/response.rb
Instance Method Summary collapse
- #body ⇒ Object
- #header(header_name) ⇒ Object
-
#initialize(builtin_response) ⇒ HTTPResponse
constructor
A new instance of HTTPResponse.
- #json ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(builtin_response) ⇒ HTTPResponse
Returns a new instance of HTTPResponse.
2 3 4 |
# File 'lib/gitlab-burndown/net/http/response.rb', line 2 def initialize(builtin_response) @builtin_response = builtin_response end |
Instance Method Details
#body ⇒ Object
6 7 8 |
# File 'lib/gitlab-burndown/net/http/response.rb', line 6 def body @builtin_response.body end |
#header(header_name) ⇒ Object
18 19 20 |
# File 'lib/gitlab-burndown/net/http/response.rb', line 18 def header(header_name) @builtin_response[header_name] end |
#json ⇒ Object
14 15 16 |
# File 'lib/gitlab-burndown/net/http/response.rb', line 14 def json JSON.parse(body) end |
#text ⇒ Object
10 11 12 |
# File 'lib/gitlab-burndown/net/http/response.rb', line 10 def text body end |