Module: RuboCop::Cop::NodeNameHelp
- Included in:
- Yardoc::ClassDescription, Yardoc::ConstantDescription, Yardoc::MethodDescription, Yardoc::ModuleDescription
- Defined in:
- lib/rubocop/cop/mixin/node_name_help.rb
Overview
Helper methods to work with Rubocop node names
Instance Method Summary collapse
-
#fully_qualified_name(node) ⇒ String
Resolves the fully-qualified name of a module or class node by walking up the ancestor chain.
Instance Method Details
#fully_qualified_name(node) ⇒ String
Resolves the fully-qualified name of a module or class node by walking up the ancestor chain.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rubocop/cop/mixin/node_name_help.rb', line 13 def fully_qualified_name(node) parts = [] current = node while current parts.unshift(current.children.first.const_name) if current.module_type? || current.class_type? current = current.parent end parts.join('::') end |