trabajo-afectivo/lib/event_buffer.rb

19 lines
309 B
Ruby
Raw Normal View History

2013-06-19 12:04:09 +00:00
module EventBuffer
def self.list
Thread.current[:event_buffer] || []
end
def self.add(item)
if !Thread.current[:event_buffer]
Thread.current[:event_buffer] = []
end
Thread.current[:event_buffer].push item
end
def self.reset
Thread.current[:event_buffer] = []
end
end