Class: PageEz::PageVisitor

Inherits:
Object
  • Object
show all
Defined in:
lib/page_ez/page_visitor.rb

Instance Method Summary collapse

Constructor Details

#initializePageVisitor

Returns a new instance of PageVisitor.



3
4
5
6
7
8
9
10
# File 'lib/page_ez/page_visitor.rb', line 3

def initialize
  @visitors = [
    Visitors::DebugVisitor.new,
    Visitors::RegisteredNameVisitor.new,
    Visitors::MacroPluralizationVisitor.new,
    Visitors::MatcherCollisionVisitor.new
  ]
end

Instance Method Details

#begin_block_evaluationObject



12
13
14
15
16
# File 'lib/page_ez/page_visitor.rb', line 12

def begin_block_evaluation
  @visitors.each do |visitor|
    visitor.begin_block_evaluation
  end
end

#define_method(name) ⇒ Object



24
25
26
27
28
# File 'lib/page_ez/page_visitor.rb', line 24

def define_method(name)
  @visitors.each do |visitor|
    visitor.define_method(name)
  end
end

#end_block_evaluationObject



18
19
20
21
22
# File 'lib/page_ez/page_visitor.rb', line 18

def end_block_evaluation
  @visitors.each do |visitor|
    visitor.end_block_evaluation
  end
end

#inherit_from(subclass) ⇒ Object



30
31
32
33
34
# File 'lib/page_ez/page_visitor.rb', line 30

def inherit_from(subclass)
  @visitors.each do |visitor|
    visitor.inherit_from(subclass)
  end
end

#process_macro(macro, name, construction_strategy) ⇒ Object



60
61
62
63
64
# File 'lib/page_ez/page_visitor.rb', line 60

def process_macro(macro, name, construction_strategy)
  @visitors.each do |visitor|
    visitor.process_macro(macro, name, construction_strategy)
  end
end

#resetObject



66
67
68
69
70
# File 'lib/page_ez/page_visitor.rb', line 66

def reset
  @visitors.each do |visitor|
    visitor.reset
  end
end

#track_method_added(name, construction_strategy) ⇒ Object



36
37
38
39
40
# File 'lib/page_ez/page_visitor.rb', line 36

def track_method_added(name, construction_strategy)
  @visitors.each do |visitor|
    visitor.track_method_added(name, construction_strategy)
  end
end

#track_method_delegated(name) ⇒ Object



54
55
56
57
58
# File 'lib/page_ez/page_visitor.rb', line 54

def track_method_delegated(name)
  @visitors.each do |visitor|
    visitor.track_method_delegated(name)
  end
end

#track_method_renamed(from, to) ⇒ Object



48
49
50
51
52
# File 'lib/page_ez/page_visitor.rb', line 48

def track_method_renamed(from, to)
  @visitors.each do |visitor|
    visitor.track_method_renamed(from, to)
  end
end

#track_method_undefined(name) ⇒ Object



42
43
44
45
46
# File 'lib/page_ez/page_visitor.rb', line 42

def track_method_undefined(name)
  @visitors.each do |visitor|
    visitor.track_method_undefined(name)
  end
end