Sha256: 8004fc0b185d156ae307bc7c835b88604f657350a15a0bf13030221818340f42

Contents?: true

Size: 349 Bytes

Versions: 1

Compression:

Stored size: 349 Bytes

Contents

module Dry
  module Logic
    class Rule::Result < Rule
      def call(input)
        result = input[name]
        result_input = result.input

        if result.success?
          Result::Wrapped.new(input, predicate.(result_input), self)
        else
          result
        end
      end

      def type
        :res
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dry-logic-0.1.2 lib/dry/logic/rule/result.rb