Class: What::Modules::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/what/modules/base.rb

Direct Known Subclasses

Existence, Processes, Unicorn, What

Instance Method Summary collapse

Constructor Details

#initializeBase

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

#detailsObject



26
27
28
# File 'lib/what/modules/base.rb', line 26

def details
  {}
end

#healthObject



22
23
24
# File 'lib/what/modules/base.rb', line 22

def health
  raise "Module #{self.class.name} doesn't override 'health'"
end

#nameObject



11
12
13
# File 'lib/what/modules/base.rb', line 11

def name
  Helpers.underscore(self.class.name.split('::').last)
end

#statusObject



18
19
20
# File 'lib/what/modules/base.rb', line 18

def status
  {'health' => health}.merge(details)
end