Sha256: bdccaf8d59b1b2c8daea5bead1df39855348e2689fab47ff810c6e1104ce3efc

Contents?: true

Size: 481 Bytes

Versions: 8

Compression:

Stored size: 481 Bytes

Contents

# frozen_string_literal: true

module Leftovers
  module Processors
    class DeletePrefix
      include ComparableInstance

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

        freeze
      end

      def process(str, current_node, matched_node, acc)
        return unless str

        @then_processor.process(str.delete_prefix(@prefix), 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/delete_prefix.rb
leftovers-0.12.1 lib/leftovers/processors/delete_prefix.rb
leftovers-0.12.0 lib/leftovers/processors/delete_prefix.rb
leftovers-0.11.2 lib/leftovers/processors/delete_prefix.rb
leftovers-0.11.1 lib/leftovers/processors/delete_prefix.rb
leftovers-0.11.0 lib/leftovers/processors/delete_prefix.rb
leftovers-0.10.0 lib/leftovers/processors/delete_prefix.rb
leftovers-0.9.0 lib/leftovers/processors/delete_prefix.rb