Class: Eipiai::HealthCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/eipiai/resources/health.rb

Overview

HealthCheck

Class with a ‘#healthy?` method. If this method returns `true`, the service is expected to be available and ready to serve requests.

Instance Method Summary collapse

Instance Method Details

#healthy?true, false

healthy?

Can be overwritten with custom logic to determine health status.

Returns:

  • (true, false)

    health status of service



20
21
22
# File 'lib/eipiai/resources/health.rb', line 20

def healthy?
  Eipiai.configuration.healthy == true
end

#to_hHash

to_h

Hash representation of the health status.

Returns:

  • (Hash)

    hash representation of health status



30
31
32
# File 'lib/eipiai/resources/health.rb', line 30

def to_h
  { 'healthy' => healthy? }
end