class TRecs::FileFramesStrategy

Attributes

frames[RW]

Public Class Methods

new(dirname) click to toggle source
# File lib/trecs/strategies/file_frames_strategy.rb, line 6
def initialize(dirname)
  @frames = Dir.entries(dirname)
    .select { |d| d =~ /\d+/}
    .each_with_object(Hash.new) do |filename, h|
    h[filename.to_i] = File.read(dirname + "/" + filename)
  end
end

Public Instance Methods

inspect() click to toggle source
# File lib/trecs/strategies/file_frames_strategy.rb, line 25
def inspect
  "<#{self.class}: frames: #{frames}>"
end
perform() click to toggle source
# File lib/trecs/strategies/file_frames_strategy.rb, line 14
def perform
  @frames.each do |time, content|
    current_time(time)
    current_content(content)
    save_frame
  end
end
stop() click to toggle source
# File lib/trecs/strategies/file_frames_strategy.rb, line 22
def stop
end