Module: God::Configurable

Module | God::Configurable
In: | lib/god/configurable.rb

### Methods

base_name complain complain friendly_name prepare reset valid?

### Public Class methods

complain(text, c = nil)

### Public Instance methods

base_name()
complain(text, c = nil)
friendly_name()
prepare()

Override this method in your Configurable (optional)

Called once after the Configurable has been sent to the block and attributes have been set. Do any post-processing on attributes here

reset()
valid?()

Override this method in your Configurable (optional)

Called once during evaluation of the config file. Return true if valid, false otherwise

A convenience method ‘complain’ is available that will print out a message and return false, making it easy to report multiple validation errors:

      def valid?
        valid = true
        valid &= complain("You must specify the 'pid_file' attribute for :memory_usage") if self.pid_file.nil?
        valid &= complain("You must specify the 'above' attribute for :memory_usage") if self.above.nil?
        valid
      end

[Validate]