# File lib/god/configurable.rb, line 33 def base_name x = 1 # fix for MRI's local scope optimization bug DO NOT REMOVE! @base_name ||= self.class.name.split('::').last end
# File lib/god/configurable.rb, line 52 def complain(text, c = nil) Configurable.complain(text, c) end
# File lib/god/configurable.rb, line 38 def friendly_name base_name end
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
# File lib/god/configurable.rb, line 8 def prepare end
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
# File lib/god/configurable.rb, line 29 def valid? true end
Generated with the Darkfish Rdoc Generator 2.