Class: Serega::Attribute::CheckBlock
- Inherits:
-
Object
- Object
- Serega::Attribute::CheckBlock
- Defined in:
- lib/serega/validations/attribute/check_block.rb
Class Method Summary collapse
-
.call(opts, block) ⇒ void
Checks :value option or a block provided with attribute Must have up to two arguments - object and context.
Class Method Details
.call(opts, block) ⇒ void
This method returns an undefined value.
Checks :value option or a block provided with attribute Must have up to two arguments - object and context. It should not have any *rest or **key arguments
28 29 30 31 32 33 34 35 36 |
# File 'lib/serega/validations/attribute/check_block.rb', line 28 def call(opts, block) check_both_provided(opts, block) if block check_block(block) elsif opts.key?(:value) check_value(opts[:value]) end end |