Class: XSignature::SignatureMultiValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/x-signature/signature_multi_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#validatorsObject

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

Returns:

  • (Boolean)


10
11
12
# File 'lib/x-signature/signature_multi_validator.rb', line 10

def valid?(data)
  validators.any? { |validator| validator.valid?(data) }
end