Class: ConfCtl::HealthChecks::Systemd::Properties
- Defined in:
- lib/confctl/health_checks/systemd/properties.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(machine, property_checks:, pattern: nil) ⇒ Properties
constructor
A new instance of Properties.
- #message ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(machine, property_checks:, pattern: nil) ⇒ Properties
Returns a new instance of Properties.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/confctl/health_checks/systemd/properties.rb', line 8 def initialize(machine, property_checks:, pattern: nil) super(machine) @pattern = pattern @property_checks = property_checks @shortest_timeout = property_checks.inject(nil) do |acc, check| if acc.nil? || check.timeout < acc check.timeout else acc end end @shortest_cooldown = property_checks.inject(nil) do |acc, check| if acc.nil? || check.cooldown < acc check.cooldown else acc end end end |
Instance Method Details
#description ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/confctl/health_checks/systemd/properties.rb', line 28 def description ret = '' if @pattern ret << @pattern << ': ' else ret << 'systemd: ' end ret << @property_checks.map(&:to_s).join(', ') ret end |
#message ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/confctl/health_checks/systemd/properties.rb', line 41 def if @pattern "#{@pattern}: #{super}" else super end end |