Class: Waw::Validation::MissingValidator
- Defined in:
- lib/waw/validation/missing_validator.rb
Instance Method Summary collapse
-
#convert_and_validate(*values) ⇒ Object
Converts and validate.
-
#validate(*values) ⇒ Object
Calls the block installed at initialization time.
Methods inherited from Validator
#&, #===, #=~, #initialize, #not, #|
Methods included from Helpers
#all_missing?, #any_missing?, #argument_safe, #error, #is_missing?, #missings_to_nil, #no_missing?, #to_validator
Constructor Details
This class inherits a constructor from Waw::Validation::Validator
Instance Method Details
#convert_and_validate(*values) ⇒ Object
Converts and validate
11 12 13 |
# File 'lib/waw/validation/missing_validator.rb', line 11 def convert_and_validate(*values) validate(*values) ? [true, missings_to_nil(values)] : [false, values] end |
#validate(*values) ⇒ Object
Calls the block installed at initialization time
6 7 8 |
# File 'lib/waw/validation/missing_validator.rb', line 6 def validate(*values) values.all?{|value| is_missing?(value)} end |