Class: Hydra::PCDM::Validators::CompositeValidator
- Inherits:
-
Object
- Object
- Hydra::PCDM::Validators::CompositeValidator
- Defined in:
- lib/hydra/pcdm/validators/composite_validator.rb
Overview
Object which acts as one validator but delegates to many.
Instance Attribute Summary collapse
-
#validators ⇒ Object
readonly
Returns the value of attribute validators.
Instance Method Summary collapse
-
#initialize(*validators) ⇒ CompositeValidator
constructor
A new instance of CompositeValidator.
- #validate!(reflection, record) ⇒ Object
Constructor Details
#initialize(*validators) ⇒ CompositeValidator
Returns a new instance of CompositeValidator.
7 8 9 |
# File 'lib/hydra/pcdm/validators/composite_validator.rb', line 7 def initialize(*validators) @validators = validators.compact end |
Instance Attribute Details
#validators ⇒ Object (readonly)
Returns the value of attribute validators.
5 6 7 |
# File 'lib/hydra/pcdm/validators/composite_validator.rb', line 5 def validators @validators end |
Instance Method Details
#validate!(reflection, record) ⇒ Object
11 12 13 14 15 |
# File 'lib/hydra/pcdm/validators/composite_validator.rb', line 11 def validate!(reflection, record) validators.each do |validator| validator.validate!(reflection, record) end end |