Sha256: d649a6a11115edf9d811f7e39d4974de001b20581dfa250657879430a18f5cbf

Contents?: true

Size: 532 Bytes

Versions: 8

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

module Leftovers
  module Processors
    class MatchCurrentNode
      include ComparableInstance

      attr_reader :matcher, :then_processor

      def initialize(matcher, then_processor)
        @matcher = matcher
        @then_processor = then_processor

        freeze
      end

      def process(str, current_node, matched_node, acc)
        return unless @matcher === current_node

        @then_processor.process(str, current_node, matched_node, acc)
      end

      freeze
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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