Module: Log::Events

Defined in:
lib/log/events.rb

Constant Summary collapse

EVENTS_KEY =
:log_events

Class Method Summary collapse

Class Method Details

.add(name, data) ⇒ Object



5
6
7
8
# File 'lib/log/events.rb', line 5

def self.add(name, data)
  Thread.current[EVENTS_KEY] = all.push({ :name => name, :data => data })
  return self
end

.allObject



15
16
17
# File 'lib/log/events.rb', line 15

def self.all
  (Thread.current[EVENTS_KEY] || []).dup
end

.resetObject



10
11
12
13
# File 'lib/log/events.rb', line 10

def self.reset
  Thread.current[EVENTS_KEY] = []
  return self
end