Sha256: 10b8c13bdbed4c30c9aafcbcf0c36877ac17d2a46026d00f94fe33a303980a87
Contents?: true
Size: 715 Bytes
Versions: 5
Compression:
Stored size: 715 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop # Common functionality for checking `rescue` nodes. module RescueNode def on_new_investigation @modifier_locations = processed_source.tokens.select(&:rescue_modifier?).map(&:pos) end private def rescue_modifier?(node) return false unless node.respond_to?(:resbody_type?) node.resbody_type? && @modifier_locations.include?(node.loc.keyword) end # @deprecated Use ResbodyNode#exceptions instead def rescued_exceptions(resbody) rescue_group, = *resbody if rescue_group rescue_group.values else [] end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems