Module: Subvalid::Validator::DSL
- Included in:
- BlockValidator::Context
- Defined in:
- lib/subvalid/validator.rb
Defined Under Namespace
Classes: ValidatorEntry
Constant Summary collapse
- MODIFIERS =
[:if]
Instance Method Summary collapse
Instance Method Details
#validates(*attributes, **validators, &block) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/subvalid/validator.rb', line 14 def validates(*attributes, **validators, &block) if validators.empty? && !block raise "no validations or block specified" end attributes = [:base] if attributes.empty? add_validations(attributes, validators, block) end |