Sha256: 5801da62f11130cf724a58d0749339e30ef670ddd089dd811df37187368f48e9

Contents?: true

Size: 714 Bytes

Versions: 8

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

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

      private

      def first_argument_range(node)
        first_argument = node.first_argument

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

      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
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubocop-minitest-0.9.0 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.8.1 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.8.0 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.7.0 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.6.2 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.6.1 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.6.0 lib/rubocop/cop/mixin/argument_range_helper.rb
rubocop-minitest-0.5.1 lib/rubocop/cop/mixin/argument_range_helper.rb