Sha256: b2df187bffbe65095deedf709c461d89a6cc6c0185b199f31d35e9abd4cc35e2
Contents?: true
Size: 690 Bytes
Versions: 7
Compression:
Stored size: 690 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Rake module Helper module ClassDefinition extend NodePattern::Macros extend self def_node_matcher :class_definition?, <<~PATTERN { class module sclass (block (send (const {nil? cbase} {:Class :Module}) :new) args _ ) } PATTERN def in_class_definition?(node) node.each_ancestor(:class, :module, :sclass, :block).any? do |a| class_definition?(a) end end end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems