Module: Debug::Eventable

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

Class Method Summary collapse

Class Method Details

.pretty_print(obj, depth = 0) ⇒ Object


3
4
5
6
7
8
9
10
11
12
# File 'lib/moon/packages/debug/eventable.rb', line 3

def self.pretty_print(obj, depth = 0)
  last_key = nil
  obj.each_listener do |key, listener|
    if last_key != key
      puts Debug.format_depth("~ #{key}", depth)
      last_key = key
    end
    puts Debug.format_depth("` <#{listener.class} @filter=#{listener.filter} @callback=#{listener.callback}>", depth + 1)
  end
end