lib/jm/dsl/validator.rb
# Validate an object by applying the registered validators
#
# Validators are applied in registration order and validation fails with
# the first failure or succeeds, if all validations succeed.
Validate an object by applying the registered validators
Validators are applied in registration order and validation fails with
the first failure or succeeds, if all validations succeed.
Validate an object by applying the registered validators Validators are applied in registration order and validation fails with the first failure or succeeds if all validations succeed .
def validate(object)
        @validators.reduce(Success.new(object)) do |result, validator|
          result.map do |value|
            validator.validate(value)
          end
        end
      end
def validate ( object ) @validators . reduce ( Success . new ( object ) ) do | result , validator | result . map do | value | validator . validate ( value ) end end end
Validate an object by applying the registered validators
Validators are applied in registration order and validation fails with
the first failure or succeeds, if all validations succeed.
Validate an object by applying the registered validators Validators are applied in registration order and validation fails with the first failure or succeeds if all validations succeed .
object