Class: Stannum::Constraints::Properties::Matching
- Defined in:
- lib/stannum/constraints/properties/matching.rb
Overview
Abstract base class for property matching constraints.
Direct Known Subclasses
Constant Summary
Constants inherited from Base
Constants inherited from Base
Base::NEGATED_TYPE, Base::TYPE
Instance Attribute Summary collapse
-
#reference_name ⇒ String, Symbol
readonly
The name of the reference property to compare to.
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(reference_name, *property_names, **options) ⇒ Matching
constructor
A new instance of Matching.
Methods inherited from Base
Methods inherited from Base
#==, #clone, #does_not_match?, #dup, #errors_for, #match, #matches?, #message, #negated_errors_for, #negated_match, #negated_message, #negated_type, #type, #with_options
Constructor Details
#initialize(reference_name, *property_names, **options) ⇒ Matching
Returns a new instance of Matching.
20 21 22 23 24 25 26 |
# File 'lib/stannum/constraints/properties/matching.rb', line 20 def initialize(reference_name, *property_names, **) @reference_name = reference_name validate_reference_name super(*property_names, reference_name: reference_name, **) end |
Instance Attribute Details
#reference_name ⇒ String, Symbol (readonly)
Returns the name of the reference property to compare to.
29 30 31 |
# File 'lib/stannum/constraints/properties/matching.rb', line 29 def reference_name @reference_name end |