Sha256: d44e0603d9f076505824b345fff3a3697a00482d492123b6001be4c050d28107

Contents?: true

Size: 380 Bytes

Versions: 5

Compression:

Stored size: 380 Bytes

Contents

module Dry
  module Logic
    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)
        Logic.Result(input, predicate.(*input), self)
      end

      def type
        :group
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-logic-0.1.4 lib/dry/logic/rule/group.rb
dry-logic-0.1.3 lib/dry/logic/rule/group.rb
dry-logic-0.1.2 lib/dry/logic/rule/group.rb
dry-logic-0.1.1 lib/dry/logic/rule/group.rb
dry-logic-0.1.0 lib/dry/logic/rule/group.rb