Method: God::Configurable#valid?
- Defined in:
- lib/god/configurable.rb
#valid? ⇒ Boolean
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
29 30 31 |
# File 'lib/god/configurable.rb', line 29 def valid? true end |