Sha256: f8079596f69ff732d2dd612561988083491248cc05c942f90ca1f80b0ba8e759

Contents?: true

Size: 674 Bytes

Versions: 82

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # Common functionality for working with string interpolations.
    #
    # @abstract Subclasses are expected to implement {#on_interpolation}.
    module Interpolation
      def on_dstr(node)
        on_node_with_interpolations(node)
      end

      alias on_xstr on_dstr
      alias on_dsym on_dstr
      alias on_regexp on_dstr

      def on_node_with_interpolations(node)
        node.each_child_node(:begin) do |begin_node|
          on_interpolation(begin_node)
        end
      end

      # @!method on_interpolation(begin_node)
      #   Inspect the `:begin` node of an interpolation
    end
  end
end

Version data entries

82 entries across 70 versions & 6 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/interpolation.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/interpolation.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/interpolation.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/interpolation.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/interpolation.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.12.1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.12.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.11.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.10.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.9.1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.9.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.8.1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.8.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.7.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.6.1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.6.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.5.2 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.5.1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-1.5.0 lib/rubocop/cop/mixin/interpolation.rb