Sha256: b70b2beec8b85a682eed59bc02132707c744add6abd1f589a02d058cfcd05c73

Contents?: true

Size: 291 Bytes

Versions: 5

Compression:

Stored size: 291 Bytes

Contents

module Dry
  module Logic
    class Rule::Key < Rule
      def self.new(name, predicate)
        super(name, predicate.curry(name))
      end

      def type
        :key
      end

      def call(input)
        Logic.Result(input[name], predicate.(input), self)
      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/key.rb
dry-logic-0.1.3 lib/dry/logic/rule/key.rb
dry-logic-0.1.2 lib/dry/logic/rule/key.rb
dry-logic-0.1.1 lib/dry/logic/rule/key.rb
dry-logic-0.1.0 lib/dry/logic/rule/key.rb