Sha256: 972919eb315d32aec99c1674e72a2bcf253cf48327c4f43d2713b8582ea4ad4e

Contents?: true

Size: 390 Bytes

Versions: 4

Compression:

Stored size: 390 Bytes

Contents

module Dry
  module Validation
    class Rule::Group < Rule
      attr_reader :rules

      def initialize(identifier, predicate)
        name, rules = identifier.to_a.first
        @rules = rules
        super(name, predicate)
      end

      def call(*input)
        Validation.Result(input, predicate.(*input), self)
      end

      def type
        :group
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-validation-0.4.1 lib/dry/validation/rule/group.rb
dry-validation-0.4.0 lib/dry/validation/rule/group.rb
dry-validation-0.3.1 lib/dry/validation/rule/group.rb
dry-validation-0.3.0 lib/dry/validation/rule/group.rb