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
rubocop-0.87.1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.87.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.86.0 lib/rubocop/cop/mixin/interpolation.rb
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/rubocop-0.85.1/lib/rubocop/cop/mixin/interpolation.rb
rbhint-0.85.1.rc2 lib/rubocop/cop/mixin/interpolation.rb
rbhint-0.85.1.rc1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.85.1 lib/rubocop/cop/mixin/interpolation.rb
rbhint-0.8.5.rc1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.85.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.84.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.83.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.82.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.81.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.80.1 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.80.0 lib/rubocop/cop/mixin/interpolation.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/rubocop-0.79.0/lib/rubocop/cop/mixin/interpolation.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.79.0/lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.79.0 lib/rubocop/cop/mixin/interpolation.rb
rubocop-0.78.0 lib/rubocop/cop/mixin/interpolation.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/rubocop-0.77.0/lib/rubocop/cop/mixin/interpolation.rb