class Reek::Context::GhostContext
Semi-transparent context to represent a metaclass while building the context tree. This context will not be part of the resulting tree, but will track context and visibility separately while building is in progress.
Attributes
Public Instance Methods
Source
# File lib/reek/context/ghost_context.rb, line 19 def append_child_context(child) real_parent = parent.append_child_context(child) super real_parent end
Calls superclass method
Source
# File lib/reek/context/ghost_context.rb, line 34 def attribute_context_class SingletonAttributeContext end
Return the correct class for child attribute contexts. For GhostContext
, this is the class that represents singleton attributes.
Source
# File lib/reek/context/ghost_context.rb, line 28 def method_context_class SingletonMethodContext end
Return the correct class for child method contexts (representing nodes of type ‘:def`). For GhostContext
, this is the class that represents singleton methods.
Source
# File lib/reek/context/ghost_context.rb, line 44 def record_use_of_self parent.record_use_of_self end
Source
# File lib/reek/context/ghost_context.rb, line 15 def register_with_parent(parent) @parent = parent end
Source
# File lib/reek/context/ghost_context.rb, line 48 def statement_counter parent.statement_counter end
Source
# File lib/reek/context/ghost_context.rb, line 38 def track_visibility(visibility, names) visibility_tracker.track_visibility children: children, visibility: visibility, names: names end