Class: ConfCtl::HealthChecks::Systemd::PropertyCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/confctl/health_checks/systemd/property_check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ PropertyCheck

Returns a new instance of PropertyCheck.



15
16
17
18
19
20
# File 'lib/confctl/health_checks/systemd/property_check.rb', line 15

def initialize(opts)
  @property = opts['property']
  @value = opts['value']
  @timeout = opts['timeout']
  @cooldown = opts['cooldown']
end

Instance Attribute Details

#cooldownInteger (readonly)

Returns:

  • (Integer)


13
14
15
# File 'lib/confctl/health_checks/systemd/property_check.rb', line 13

def cooldown
  @cooldown
end

#propertyString (readonly)

Returns:

  • (String)


4
5
6
# File 'lib/confctl/health_checks/systemd/property_check.rb', line 4

def property
  @property
end

#timeoutInteger (readonly)

Returns:

  • (Integer)


10
11
12
# File 'lib/confctl/health_checks/systemd/property_check.rb', line 10

def timeout
  @timeout
end

#valueString (readonly)

Returns:

  • (String)


7
8
9
# File 'lib/confctl/health_checks/systemd/property_check.rb', line 7

def value
  @value
end

Instance Method Details

#check(v) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/confctl/health_checks/systemd/property_check.rb', line 23

def check(v)
  @value == v
end

#to_sObject



27
28
29
# File 'lib/confctl/health_checks/systemd/property_check.rb', line 27

def to_s
  "#{property}=#{value}"
end