Class: HTTPResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab-burndown/net/http/response.rb

Instance Method Summary collapse

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

#bodyObject



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

#jsonObject



14
15
16
# File 'lib/gitlab-burndown/net/http/response.rb', line 14

def json
  JSON.parse(body)
end

#textObject



10
11
12
# File 'lib/gitlab-burndown/net/http/response.rb', line 10

def text
  body
end