trabajo-afectivo/lib/event_buffer.rb

18 lines
308 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
2015-01-02 15:48:28 +00:00
end