Class: Validatable::ChildValidation
- Defined in:
- lib/gems/validatable-1.6.7/lib/child_validation.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Returns the value of attribute attribute.
-
#map ⇒ Object
Returns the value of attribute map.
-
#should_validate_proc ⇒ Object
Returns the value of attribute should_validate_proc.
Instance Method Summary collapse
-
#initialize(attribute, map, should_validate_proc) ⇒ ChildValidation
constructor
A new instance of ChildValidation.
- #should_validate?(instance) ⇒ Boolean
Constructor Details
#initialize(attribute, map, should_validate_proc) ⇒ ChildValidation
Returns a new instance of ChildValidation.
5 6 7 8 9 |
# File 'lib/gems/validatable-1.6.7/lib/child_validation.rb', line 5 def initialize(attribute, map, should_validate_proc) @attribute = attribute @map = map @should_validate_proc = should_validate_proc end |
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
3 4 5 |
# File 'lib/gems/validatable-1.6.7/lib/child_validation.rb', line 3 def attribute @attribute end |
#map ⇒ Object
Returns the value of attribute map.
3 4 5 |
# File 'lib/gems/validatable-1.6.7/lib/child_validation.rb', line 3 def map @map end |
#should_validate_proc ⇒ Object
Returns the value of attribute should_validate_proc.
3 4 5 |
# File 'lib/gems/validatable-1.6.7/lib/child_validation.rb', line 3 def should_validate_proc @should_validate_proc end |
Instance Method Details
#should_validate?(instance) ⇒ Boolean
11 12 13 |
# File 'lib/gems/validatable-1.6.7/lib/child_validation.rb', line 11 def should_validate?(instance) instance.instance_eval &should_validate_proc end |