Class: HealthcheckEndpoint::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/healthcheck_endpoint/resolver.rb

Constant Summary collapse

PROBE_ENDPOINTS =
%i[endpoint_startup endpoint_liveness endpoint_readiness].freeze
CONTENT_TYPE =
{ 'Content-Type' => 'application/json' }.freeze
ROOT_NAMESPACE =
'/'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rack_env) ⇒ Resolver

Returns a new instance of Resolver.



17
18
19
# File 'lib/healthcheck_endpoint/resolver.rb', line 17

def initialize(rack_env)
  @request = ::Rack::Request.new(rack_env)
end

Class Method Details

.call(rack_env) ⇒ Object



13
14
15
# File 'lib/healthcheck_endpoint/resolver.rb', line 13

def self.call(rack_env)
  new(rack_env).call
end

Instance Method Details

#callObject



21
22
23
24
25
# File 'lib/healthcheck_endpoint/resolver.rb', line 21

def call
  return unless probe_name

  [response_status, HealthcheckEndpoint::Resolver::CONTENT_TYPE, [response_jsonapi]]
end