Module: Automatic::Config::Validator::ValidateRule
- Defined in:
- lib/config/validator.rb
Class Method Summary collapse
Class Method Details
.default(config, name, *args) ⇒ Object
75 76 77 78 |
# File 'lib/config/validator.rb', line 75 def self.default(config, name, *args) config[name.to_s] ||= args.first true end |
.required(config, name, *args) ⇒ Object
69 70 71 72 73 |
# File 'lib/config/validator.rb', line 69 def self.required(config, name, *args) return true unless args.size < 1 or args.first return true if not config[name.to_s].nil? and not config[name.to_s].empty? false end |