class Consul::Async::HttpResponse

Basic Encapsulation of HTTP response from Consul It supports empty responses to handle first call is an easy way

Encapsulation of HTTP Response

Attributes

error[R]
response[R]
response_header[R]

Public Class Methods

new(http, override_nil_response = nil) click to toggle source
# File lib/consul/async/consul_endpoint.rb, line 128
def initialize(http, override_nil_response = nil)
  if http.nil?
    @response_header = nil
    @response = override_nil_response
    @error = 'Not initialized yet'
  else
    @response_header = http.response_header.nil? ? nil : http.response_header.dup.freeze
    @response = http.response.nil? || http.response.empty? ? override_nil_response : http.response.dup.freeze
    @error = http.error.nil? ? nil : http.error.dup.freeze
  end
end