Class: Consul::Async::VaultHttpResponse
- Inherits:
-
Object
- Object
- Consul::Async::VaultHttpResponse
- Defined in:
- lib/consul/async/vault_endpoint.rb
Overview
VaultHttpResponse supports empty results (when no data has been received yet)
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#response_header ⇒ Object
readonly
Returns the value of attribute response_header.
Instance Method Summary collapse
-
#initialize(http, override_nil_response = nil) ⇒ VaultHttpResponse
constructor
A new instance of VaultHttpResponse.
Constructor Details
#initialize(http, override_nil_response = nil) ⇒ VaultHttpResponse
Returns a new instance of VaultHttpResponse.
114 115 116 117 118 119 120 121 122 123 124 125 |
# 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 |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
112 113 114 |
# File 'lib/consul/async/vault_endpoint.rb', line 112 def error @error end |
#json ⇒ Object (readonly)
Returns the value of attribute json.
112 113 114 |
# File 'lib/consul/async/vault_endpoint.rb', line 112 def json @json end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
112 113 114 |
# File 'lib/consul/async/vault_endpoint.rb', line 112 def response @response end |
#response_header ⇒ Object (readonly)
Returns the value of attribute response_header.
112 113 114 |
# File 'lib/consul/async/vault_endpoint.rb', line 112 def response_header @response_header end |