class SocketLabs::InjectionApi::Core::HttpResponse

Attributes

body[R]
headers[R]
status_code[R]

Public Class Methods

new(response) click to toggle source
# File lib/socketlabs/injectionapi/core/http_response.rb, line 12
def initialize(response)
  @status_code = response.code
  @body = response.body
  @headers = response.to_hash
end

Public Instance Methods

to_hash() click to toggle source

Returns the body as a hash

# File lib/socketlabs/injectionapi/core/http_response.rb, line 19
def to_hash
  @parsed_body ||= JSON.parse(@body, symbolize_names: true)
end