Class: Validatable::ValidatesTrueFor
- Inherits:
-
ValidationBase
- Object
- ValidationBase
- Validatable::ValidatesTrueFor
- Defined in:
- lib/validatable/validations/validates_true_for.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from ValidationBase
Instance Method Summary collapse
Methods inherited from ValidationBase
after_validate, after_validations, all_after_validations, all_defaults, default, defaults, #i18n_prefix, #initialize, option, #raise_error_if_key_is_dup, required_option, #run_after_validate, #should_validate?, #validate_this_time?
Methods included from Requireable
Methods included from Understandable
Constructor Details
This class inherits a constructor from Validatable::ValidationBase
Instance Method Details
#i18n ⇒ Object
13 14 15 |
# File 'lib/validatable/validations/validates_true_for.rb', line 13 def i18n super || "#{i18n_prefix}.true" end |
#message(instance) ⇒ Object
9 10 11 |
# File 'lib/validatable/validations/validates_true_for.rb', line 9 def (instance) super || "is invalid" end |
#valid?(instance) ⇒ Boolean
5 6 7 |
# File 'lib/validatable/validations/validates_true_for.rb', line 5 def valid?(instance) instance.instance_eval(&logic) == true end |