Sha256: 841b8a31f51bee5a9e068b5415b7473579f4f27e4ef14ed50711b8039d593d83

Contents?: true

Size: 477 Bytes

Versions: 4

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module Leftovers
  module Matchers
    class NodeHasAnyPositionalArgumentWithValue
      # :nocov:
      using ::Leftovers::Backports::SetCaseEq if defined?(::Leftovers::Backports::SetCaseEq)
      # :nocov:

      def initialize(matcher)
        @matcher = matcher

        freeze
      end

      def ===(node)
        node.positional_arguments.any? do |value|
          @matcher === value
        end
      end

      freeze
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
leftovers-0.4.3 lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb
leftovers-0.4.2 lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb
leftovers-0.4.1 lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb
leftovers-0.4.0 lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb