Class: Stdout::SingleFile

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

Defined Under Namespace

Classes: FrameIterator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ SingleFile

Returns a new instance of SingleFile.



10
11
12
# File 'lib/asciinema/stdout.rb', line 10

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/asciinema/stdout.rb', line 8

def path
  @path
end

Instance Method Details

#each(&blk) ⇒ Object



14
15
16
17
18
# File 'lib/asciinema/stdout.rb', line 14

def each(&blk)
  open(path, 'r') do |f|
    Oj.sc_parse(FrameIterator.new(blk), f)
  end
end