Class: Dryad::Consul::HealthCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/dryad/consul/health_check.rb

Direct Known Subclasses

GRPCHealthCheck, HTTPHealthCheck, TTLHealthCheck

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(duration) ⇒ HealthCheck

Returns a new instance of HealthCheck.



6
7
8
# File 'lib/dryad/consul/health_check.rb', line 6

def initialize(duration)
  @deregister_critical_service_after = "#{duration}s"
end

Instance Attribute Details

#deregister_critical_service_afterObject

Returns the value of attribute deregister_critical_service_after.



4
5
6
# File 'lib/dryad/consul/health_check.rb', line 4

def deregister_critical_service_after
  @deregister_critical_service_after
end

Instance Method Details

#attributesObject



10
11
12
13
14
15
# File 'lib/dryad/consul/health_check.rb', line 10

def attributes
  self.instance_variables.map do |attribute|
    key = attribute.to_s.gsub('@', '')
    [key, self.instance_variable_get(attribute)]
  end.to_h
end