Module: Debug::RenderContainer

Defined in:
lib/moon/packages/debug/render_container.rb

Class Method Summary collapse

Class Method Details

.element_info(obj) ⇒ Object


3
4
5
# File 'lib/moon/packages/debug/render_container.rb', line 3

def self.element_info(obj)
  "#{obj.visible ? "+" : "-"} #{obj.class.inspect}"
end

.pp_elements(obj, depth = 0) ⇒ Object


7
8
9
10
11
12
13
# File 'lib/moon/packages/debug/render_container.rb', line 7

def self.pp_elements(obj, depth=0)
  puts Debug.format_depth(element_info(obj), depth)  #Eventable.pretty_print(obj, depth+1)

  obj.elements.each do |element|
    pp_elements(element, depth + 1)
  end
end

.pretty_print(obj, depth = 0) ⇒ Object


15
16
17
# File 'lib/moon/packages/debug/render_container.rb', line 15

def self.pretty_print(obj, depth=0)
  pp_elements(obj, depth)
end