Class: HTTPigeon::CircuitBreaker::NullResponse

Inherits:
Faraday::Response
  • Object
show all
Defined in:
lib/httpigeon/circuit_breaker/fuse_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil, exception = nil) ⇒ NullResponse

Returns a new instance of NullResponse.



8
9
10
11
12
# File 'lib/httpigeon/circuit_breaker/fuse_config.rb', line 8

def initialize(response = nil, exception = nil)
  @api_response = response
  @exception = exception
  super(status: 503, response_headers: response&.headers || {})
end

Instance Attribute Details

#api_responseObject (readonly)

Returns the value of attribute api_response.



6
7
8
# File 'lib/httpigeon/circuit_breaker/fuse_config.rb', line 6

def api_response
  @api_response
end

#exceptionObject (readonly)

Returns the value of attribute exception.



6
7
8
# File 'lib/httpigeon/circuit_breaker/fuse_config.rb', line 6

def exception
  @exception
end