Class: What::Modules::Existence
- Inherits:
-
Base
- Object
- Base
- What::Modules::Existence
show all
- Defined in:
- lib/what/modules/existence.rb
Constant Summary
collapse
- DEFAULTS =
{
'paths' => []
}
Instance Attribute Summary
Attributes inherited from Base
#interval
Instance Method Summary
collapse
Methods inherited from Base
#identifier, #initialize, #name, #shared_status, #start_monitoring, #status
Instance Method Details
#check ⇒ Object
11
12
13
14
15
16
17
18
19
|
# File 'lib/what/modules/existence.rb', line 11
def check
@config['paths'].each do |path|
if Dir[path].count == 0
@paths[path] = false
else
@paths[path] = true
end
end
end
|
#details ⇒ Object
25
26
27
|
# File 'lib/what/modules/existence.rb', line 25
def details
@paths
end
|
#health ⇒ Object
21
22
23
|
# File 'lib/what/modules/existence.rb', line 21
def health
Helpers.overall_health(@paths.map { |k, v| v ? 'ok' : 'alert' })
end
|
#initialize_module ⇒ Object
7
8
9
|
# File 'lib/what/modules/existence.rb', line 7
def initialize_module
@paths = {}
end
|