Class: What::Modules::Base
- Inherits:
-
Object
- Object
- What::Modules::Base
show all
- Defined in:
- lib/what/modules/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
3
4
5
6
7
8
9
|
# File 'lib/what/modules/base.rb', line 3
def initialize
@config = if defined?(DEFAULTS)
DEFAULTS.merge(Config['module_config'][self.name] || {})
else
Config['module_config'][self.name]
end
end
|
Instance Method Details
#check! ⇒ Object
15
16
|
# File 'lib/what/modules/base.rb', line 15
def check!
end
|
#details ⇒ Object
26
27
28
|
# File 'lib/what/modules/base.rb', line 26
def details
{}
end
|
#health ⇒ Object
22
23
24
|
# File 'lib/what/modules/base.rb', line 22
def health
raise "Module #{self.class.name} doesn't override 'health'"
end
|
#name ⇒ Object
11
12
13
|
# File 'lib/what/modules/base.rb', line 11
def name
Helpers.underscore(self.class.name.split('::').last)
end
|
#status ⇒ Object
18
19
20
|
# File 'lib/what/modules/base.rb', line 18
def status
{'health' => health}.merge(details)
end
|