Sha256: 59f0d430413b72a64e7de4c01bc7c207dd0beecdfc6062505d697e15326a8a78

Contents?: true

Size: 375 Bytes

Versions: 8

Compression:

Stored size: 375 Bytes

Contents

# frozen_string_literal: true

module Leftovers
  module Matchers
    class NodeHasReceiver
      include ComparableInstance

      attr_reader :matcher

      def initialize(matcher)
        @matcher = matcher

        freeze
      end

      def ===(node)
        receiver = node.receiver
        @matcher === receiver if receiver
      end

      freeze
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
leftovers-0.12.2 lib/leftovers/matchers/node_has_receiver.rb
leftovers-0.12.1 lib/leftovers/matchers/node_has_receiver.rb
leftovers-0.12.0 lib/leftovers/matchers/node_has_receiver.rb
leftovers-0.11.2 lib/leftovers/matchers/node_has_receiver.rb
leftovers-0.11.1 lib/leftovers/matchers/node_has_receiver.rb
leftovers-0.11.0 lib/leftovers/matchers/node_has_receiver.rb
leftovers-0.10.0 lib/leftovers/matchers/node_has_receiver.rb
leftovers-0.9.0 lib/leftovers/matchers/node_has_receiver.rb