Sha256: b297f8e7f9c44375d5118e7a0fea3b9b5e1f89cd232ef43c0ed0da09dd252b3b

Contents?: true

Size: 338 Bytes

Versions: 4

Compression:

Stored size: 338 Bytes

Contents

# frozen_string_literal: true

module Dry
  module Logic
    module Operations
      class Negation < Unary
        def type
          :not
        end

        def call(input)
          Result.new(rule.(input).failure?, id) { ast(input) }
        end

        def [](input)
          !rule[input]
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-logic-1.6.0 lib/dry/logic/operations/negation.rb
dry-logic-1.5.0 lib/dry/logic/operations/negation.rb
dry-logic-1.4.0 lib/dry/logic/operations/negation.rb
dry-logic-1.3.0 lib/dry/logic/operations/negation.rb