Module: RKelly::Visitable::ClassMethods

Defined in:
lib/rkelly/visitable.rb

Overview

This is a big optimization impairing readability of this code. I’m sorry for that, but this path is called heavily. See git history.

Instance Method Summary collapse

Instance Method Details

#visitor_method_names_by_ancestorsObject



8
9
10
11
12
13
14
15
# File 'lib/rkelly/visitable.rb', line 8

def visitor_method_names_by_ancestors
  @visitor_method_names_by_ancestors ||= self.ancestors.reject do |i|
    %w[Kernel Object BasicObject Enumerable
       RKelly::Visitors RKelly::Visitable PP::ObjectMixin].include? i.name.to_s
  end.map do |ancestor|
    :"visit_#{ancestor.name.split('::').last}"
  end
end