class TRecs::Strategy

Attributes

__content[RW]
__format[RW]
__time[RW]
offset[RW]
recorder[RW]
step[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/trecs/strategies/strategy.rb, line 8
def initialize(options={})
  @step = options.fetch(:step) { 100 }
end

Public Instance Methods

frames() click to toggle source
# File lib/trecs/strategies/strategy.rb, line 17
def frames
  @frames ||= {}
end
stop() click to toggle source
# File lib/trecs/strategies/strategy.rb, line 21
def stop
end
write_frames_to(writer) click to toggle source
# File lib/trecs/strategies/strategy.rb, line 12
def write_frames_to(writer)
  perform
  writer.render_frames(frames)
end

Private Instance Methods

current_content(content=nil) click to toggle source
# File lib/trecs/strategies/strategy.rb, line 37
def current_content(content=nil)
  if content
    @__content = content
  end
  @__content
end
current_format(format=nil) click to toggle source
# File lib/trecs/strategies/strategy.rb, line 44
def current_format(format=nil)
  if format
    @__format = format
  end
  @__format
end
current_time(time=nil) click to toggle source
# File lib/trecs/strategies/strategy.rb, line 30
def current_time(time=nil)
  if time
    @__time = time
  end
  @__time
end
save_frame() click to toggle source
# File lib/trecs/strategies/strategy.rb, line 51
def save_frame
  frames[__time] = Frame.new(format: __format, content: __content)
end