Class: SmartProperties::Validations::Ancestor
- Inherits:
-
Object
- Object
- SmartProperties::Validations::Ancestor
- Includes:
- SmartProperties
- Defined in:
- lib/smart_properties/validations/ancestor.rb
Constant Summary
Constants included from SmartProperties
Instance Method Summary collapse
Methods included from SmartProperties
Instance Method Details
#to_proc ⇒ Object
13 14 15 16 |
# File 'lib/smart_properties/validations/ancestor.rb', line 13 def to_proc validator = self ->(klass) { validator.validate(klass) } end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/smart_properties/validations/ancestor.rb', line 18 def to_s "subclasses of #{type.to_s}" end |
#validate(klass) ⇒ Object
9 10 11 |
# File 'lib/smart_properties/validations/ancestor.rb', line 9 def validate(klass) klass.is_a?(Class) && klass < type end |