Sha256: 03b48784607e744fd405bb71bb601b2f8fefcdcf93e60ba4312f5a0f566290cd

Contents?: true

Size: 714 Bytes

Versions: 9

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # Methods that calculate and return `Parser::Source::Ranges`.
    # @api private
    module ArgumentRangeHelper
      include RangeHelp

      private

      def first_and_second_arguments_range(node)
        first_argument = node.first_argument
        second_argument = node.arguments[1]

        range_between(first_argument.source_range.begin_pos, second_argument.source_range.end_pos)
      end

      def all_arguments_range(node)
        first_argument = node.first_argument
        last_argument = node.last_argument

        range_between(first_argument.source_range.begin_pos, last_argument.source_range.end_pos)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubocop-minitest-0.36.0 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.35.1 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.35.0 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.34.5 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.34.4 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.34.3 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.34.2 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.34.1 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.34.0 lib/rubocop/cop/mixin/argument_range_helper.rb