Parent

Class/Module Index [+]

Quicksearch

Reek::Source::TreeDresser

Adorns an abstract syntax tree with mix-in modules to make accessing the tree more understandable and less implementation-dependent.

Public Instance Methods

dress(sexp) click to toggle source
# File lib/reek/source/tree_dresser.rb, line 189
def dress(sexp)
  sexp.extend(SexpNode)
  module_name = extensions_for(sexp.sexp_type)
  if SexpExtensions.const_defined?(module_name)
    sexp.extend(SexpExtensions.const_get(module_name))
  end
  sexp[0..-1].each { |sub| dress(sub) if Array === sub }
  sexp
end
extensions_for(node_type) click to toggle source
# File lib/reek/source/tree_dresser.rb, line 199
def extensions_for(node_type)
  "#{node_type.to_s.capitalize}Node"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.