class Consul::Async::VaultHttpResponse

VaultHttpResponse supports empty results (when no data has been received yet)

Attributes

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

Public Class Methods

new(http, override_nil_response = nil) click to toggle source
# File lib/consul/async/vault_endpoint.rb, line 114
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
  @json = JSON[response]
end