class RShade::EventStore
nodoc
Attributes
events[R]
Public Class Methods
new()
click to toggle source
# File lib/rshade/event_store.rb, line 6 def initialize @events = [] end
Public Instance Methods
<<(event)
click to toggle source
# File lib/rshade/event_store.rb, line 10 def <<(event) events << event end
iterate() { |item, depth| ... }
click to toggle source
# File lib/rshade/event_store.rb, line 14 def iterate(&block) pos_map = {} @events.map {|item| item.level }.uniq.sort.each_with_index { |item, index| pos_map[item] = index} @events.uniq{|item| [item.level, "#{item.klass}##{item.method_name}"]}.sort_by { |item| item.depth }.each do |item| item.depth = pos_map[item.level] yield(item, item.depth) end end