Sha256: ebf8ce18f8374a5ee763a32a287946da72e4f65136cb187e41882d447a6fb20f

Contents?: true

Size: 399 Bytes

Versions: 5

Compression:

Stored size: 399 Bytes

Contents

module ComposedValidations
  class PropertyValidator
    attr_reader :property, :validators
    def initialize(property, validators)
      @property = property
      @validators = Array(validators)
    end

    def decorate_resource(resource)
      validators.each do |validator|
        resource = WithValidatedProperty.new(resource, property, validator)
      end
      resource
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
composed_validations-0.0.5 lib/composed_validations/property_validator.rb
composed_validations-0.0.4 lib/composed_validations/property_validator.rb
composed_validations-0.0.3 lib/composed_validations/property_validator.rb
composed_validations-0.0.2 lib/composed_validations/property_validator.rb
composed_validations-0.0.1 lib/composed_validations/property_validator.rb