Class: Stdout::MultiFile

Inherits:
Stdout
  • Object
show all
Defined in:
lib/asciinema/stdout.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_path, timing_path) ⇒ MultiFile

Returns a new instance of MultiFile.



49
50
51
52
# File 'lib/asciinema/stdout.rb', line 49

def initialize(data_path, timing_path)
  @data_path = data_path
  @timing_path = timing_path
end

Instance Attribute Details

#data_pathObject (readonly)

Returns the value of attribute data_path.



47
48
49
# File 'lib/asciinema/stdout.rb', line 47

def data_path
  @data_path
end

#timing_pathObject (readonly)

Returns the value of attribute timing_path.



47
48
49
# File 'lib/asciinema/stdout.rb', line 47

def timing_path
  @timing_path
end

Instance Method Details

#eachObject



54
55
56
57
58
59
60
# File 'lib/asciinema/stdout.rb', line 54

def each
  File.open(data_path, 'rb') do |file|
    File.foreach(timing_path) do |line|
      yield(*delay_and_data_for_line(file, line))
    end
  end
end