Class: XSignature::SignatureMultiValidator
- Inherits:
-
Object
- Object
- XSignature::SignatureMultiValidator
- Defined in:
- lib/x-signature/signature_multi_validator.rb
Instance Attribute Summary collapse
-
#validators ⇒ Object
Returns the value of attribute validators.
Instance Method Summary collapse
-
#initialize(*validators) ⇒ SignatureMultiValidator
constructor
A new instance of SignatureMultiValidator.
- #valid?(data) ⇒ Boolean
Constructor Details
#initialize(*validators) ⇒ SignatureMultiValidator
Returns a new instance of SignatureMultiValidator.
6 7 8 |
# File 'lib/x-signature/signature_multi_validator.rb', line 6 def initialize(*validators) @validators = validators.flatten end |
Instance Attribute Details
#validators ⇒ Object
Returns the value of attribute validators.
4 5 6 |
# File 'lib/x-signature/signature_multi_validator.rb', line 4 def validators @validators end |
Instance Method Details
#valid?(data) ⇒ Boolean
10 11 12 |
# File 'lib/x-signature/signature_multi_validator.rb', line 10 def valid?(data) validators.any? { |validator| validator.valid?(data) } end |