class Vizsla::Recorder
Constants
- LOCK
- THREAD_LOCAL_KEY
Public Class Methods
add_event(event)
click to toggle source
# File lib/vizsla/recorder.rb, line 25 def add_event(event) return unless self.recording? self.current[event.recorder_type] ||= [] self.current[event.recorder_type] << event.prettify_data end
Also aliased as: <<
current()
click to toggle source
# File lib/vizsla/recorder.rb, line 7 def current LOCK.synchronize do Thread.current[THREAD_LOCAL_KEY] end end
current=(val)
click to toggle source
# File lib/vizsla/recorder.rb, line 13 def current=(val) Thread.current[THREAD_LOCAL_KEY] = val end
events()
click to toggle source
# File lib/vizsla/recorder.rb, line 32 def events self.current end
recording?()
click to toggle source
# File lib/vizsla/recorder.rb, line 21 def recording? !self.current.nil? end
start_recording()
click to toggle source
# File lib/vizsla/recorder.rb, line 17 def start_recording self.current = {} end
stop_recording()
click to toggle source
# File lib/vizsla/recorder.rb, line 36 def stop_recording LOCK.synchronize do Thread.current[THREAD_LOCAL_KEY] = nil end end