Class: Mongoa::MongoMapper::Matchers::ValidateBase
- Inherits:
-
Object
- Object
- Mongoa::MongoMapper::Matchers::ValidateBase
- Defined in:
- lib/mongoa/mongo_mapper/validations/validate_base.rb
Direct Known Subclasses
ValidateFormatOfMatcher, ValidateInclusionOfMatcher, ValidateLengthOfMatcher, ValidateNumericalityOfMatcher, ValidatePresenceOfMatcher, ValidateUniquenessOfMatcher
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
Instance Method Summary collapse
-
#initialize(attribute) ⇒ ValidateBase
constructor
A new instance of ValidateBase.
- #matches?(subject) ⇒ Boolean
- #validation_type ⇒ Object
- #validator_class_name ⇒ Object
Constructor Details
#initialize(attribute) ⇒ ValidateBase
Returns a new instance of ValidateBase.
7 8 9 |
# File 'lib/mongoa/mongo_mapper/validations/validate_base.rb', line 7 def initialize(attribute) @attribute = attribute end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
5 6 7 |
# File 'lib/mongoa/mongo_mapper/validations/validate_base.rb', line 5 def attribute @attribute end |
Instance Method Details
#matches?(subject) ⇒ Boolean
11 12 13 14 |
# File 'lib/mongoa/mongo_mapper/validations/validate_base.rb', line 11 def matches?(subject) @subject = subject @validation = find_validation end |
#validation_type ⇒ Object
16 17 18 |
# File 'lib/mongoa/mongo_mapper/validations/validate_base.rb', line 16 def validation_type raise "Redefine in the subclass" end |
#validator_class_name ⇒ Object
20 21 22 |
# File 'lib/mongoa/mongo_mapper/validations/validate_base.rb', line 20 def validator_class_name raise "Redefine in the subclass" end |