Class: VanillaValidator::Rules::BlockRule
- Defined in:
- lib/vanilla_validator/rules/block_rule.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
Attributes inherited from BaseRule
#attribute, #parameters, #value
Instance Method Summary collapse
Methods inherited from BaseRule
Constructor Details
This class inherits a constructor from VanillaValidator::Rules::BaseRule
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/vanilla_validator/rules/block_rule.rb', line 5 def end |
Instance Method Details
#failure_message ⇒ Object
14 15 16 |
# File 'lib/vanilla_validator/rules/block_rule.rb', line 14 def end |
#valid? ⇒ Boolean
7 8 9 10 11 12 |
# File 'lib/vanilla_validator/rules/block_rule.rb', line 7 def valid? block = parameters block.call(attribute, value, ->(msg){ self. = msg }) .nil? ? true : false end |