class TRecs::YamlStoreWriter

Attributes

file[R]
frames[R]
recorder[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/trecs/writers/yaml_store_writer.rb, line 10
def initialize(options={})
  @file = options.fetch(:trecs_file)
  FileUtils.rm(@file, force: true)
end

Public Instance Methods

create_frame(options={}) click to toggle source
# File lib/trecs/writers/yaml_store_writer.rb, line 19
def create_frame(options={})
  time = options.fetch(:time)
  content = options.fetch(:content)
  @frames[time] = content
end
render() click to toggle source
# File lib/trecs/writers/yaml_store_writer.rb, line 25
def render
  store = YAML::Store.new file
  store.transaction do
    store["frames"] = @frames
  end
end
setup() click to toggle source
# File lib/trecs/writers/yaml_store_writer.rb, line 15
def setup
  @frames = {}
end