Class: What::Modules::Base

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

Direct Known Subclasses

Unicorn

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



2
3
4
# File 'lib/what/modules/base.rb', line 2

def initialize
  @config = What::Config[self.name]
end

Instance Method Details

#check!Object



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

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

#detailsObject



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

def details
  {}
end

#healthObject



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

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

#nameObject



6
7
8
# File 'lib/what/modules/base.rb', line 6

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

#statusObject



14
15
16
# File 'lib/what/modules/base.rb', line 14

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