Class: PageEz::Visitors::DebugVisitor

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

Instance Method Summary collapse

Constructor Details

#initializeDebugVisitor

Returns a new instance of DebugVisitor.



4
5
6
# File 'lib/page_ez/visitors/debug_visitor.rb', line 4

def initialize
  reset
end

Instance Method Details

#begin_block_evaluationObject



8
9
10
# File 'lib/page_ez/visitors/debug_visitor.rb', line 8

def begin_block_evaluation
  @depth_visitor.begin_block_evaluation
end

#define_method(name) ⇒ Object



16
17
18
19
# File 'lib/page_ez/visitors/debug_visitor.rb', line 16

def define_method(name)
  @depth_visitor.define_method(name)
  debug("* #{name}")
end

#end_block_evaluationObject



12
13
14
# File 'lib/page_ez/visitors/debug_visitor.rb', line 12

def end_block_evaluation
  @depth_visitor.end_block_evaluation
end

#inherit_from(subclass) ⇒ Object



21
22
23
24
# File 'lib/page_ez/visitors/debug_visitor.rb', line 21

def inherit_from(subclass)
  @depth_visitor.inherit_from(subclass)
  debug("Declaring page object: #{subclass.name || "{anonymous page object}"}")
end

#process_macro(macro, name, construction_strategy) ⇒ Object



43
44
45
46
# File 'lib/page_ez/visitors/debug_visitor.rb', line 43

def process_macro(macro, name, construction_strategy)
  @depth_visitor.process_macro(macro, name, construction_strategy)
  debug("#{macro} :#{name}, \"#{construction_strategy.selector}\"")
end

#resetObject



48
49
50
# File 'lib/page_ez/visitors/debug_visitor.rb', line 48

def reset
  @depth_visitor = DepthVisitor.new
end

#track_method_added(name, construction_strategy) ⇒ Object



26
27
28
# File 'lib/page_ez/visitors/debug_visitor.rb', line 26

def track_method_added(name, construction_strategy)
  @depth_visitor.track_method_added(name, construction_strategy)
end

#track_method_delegated(name) ⇒ Object



38
39
40
41
# File 'lib/page_ez/visitors/debug_visitor.rb', line 38

def track_method_delegated(name)
  @depth_visitor.track_method_delegated(name)
  debug("* #{name} (delegated)")
end

#track_method_renamed(from, to) ⇒ Object



34
35
36
# File 'lib/page_ez/visitors/debug_visitor.rb', line 34

def track_method_renamed(from, to)
  @depth_visitor.track_method_renamed(from, to)
end

#track_method_undefined(name) ⇒ Object



30
31
32
# File 'lib/page_ez/visitors/debug_visitor.rb', line 30

def track_method_undefined(name)
  @depth_visitor.track_method_undefined(name)
end