Sha256: 1f1037ab28167d50846dedbbfa4bea964a4e037e64d201fae106835db4a63567
Contents?: true
Size: 646 Bytes
Versions: 6
Compression:
Stored size: 646 Bytes
Contents
module ContainersManager class ConsulEntry def initialize(data, configuration) @data = data @configuration = configuration end def set_id_provider(id_provider) @id_provider = id_provider end def deregister_if_possible deregister if can_deregister? end private attr_reader :data, :configuration, :id_provider def deregister ConsulService.new(configuration).deregister(service_id) end def can_deregister? id_provider.alive_ids.find { |id| service_id.include?(id) } end def service_id @service_id ||= data['ServiceID'] end end end
Version data entries
6 entries across 6 versions & 1 rubygems