Superclass for all types of source code context. Each instance represents a code element of some kind, and each provides behaviour relevant to that code element. CodeContexts form a tree in the same way the code does, with each context holding a reference to a unique outer context.
# File lib/reek/core/code_context.rb, line 29 def each_node(type, ignoring, &blk) @exp.each_node(type, ignoring, &blk) end
# File lib/reek/core/code_context.rb, line 50 def full_name outer = @outer ? @outer.full_name : '' exp.full_name(outer) end
# File lib/reek/core/code_context.rb, line 55 def local_config return Hash.new if @exp.nil? config = Source::CodeComment.new(@exp.comments || '').config return config unless @outer @outer.config.deep_copy.adopt!(config) # no tests for this -----^ end
# File lib/reek/core/code_context.rb, line 25 def local_nodes(type, &blk) each_node(type, [:class, :module], &blk) end
# File lib/reek/core/code_context.rb, line 33 def matches?(candidates) my_fq_name = full_name candidates.any? {|str| /#{str}/ === my_fq_name } end
Generated with the Darkfish Rdoc Generator 2.