Class: LiveF1::Source::Live::LogProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/live_f1/source/live.rb

Overview

Wraps a logfile in methods which mean the caller doesn’t need to know if a log is currently open or not

Class Method Summary collapse

Class Method Details

.flushObject

Writes the current logfile to disk



116
117
118
# File 'lib/live_f1/source/live.rb', line 116

def flush
  @log.flush if @log
end

.resetObject

Writes the current logfile to disk and then closes the log



121
122
123
124
# File 'lib/live_f1/source/live.rb', line 121

def reset
  flush
  @log = nil
end

.start(session_number) ⇒ Object



104
105
106
107
# File 'lib/live_f1/source/live.rb', line 104

def start session_number
  reset
  @log = Log.new session_number unless session_number.zero?
end