Class: Jrf::CLI::Runner::ParallelFrameReader

Inherits:
Object
  • Object
show all
Defined in:
lib/jrf/cli/runner.rb

Instance Method Summary collapse

Constructor Details

#initializeParallelFrameReader

Returns a new instance of ParallelFrameReader.



15
16
17
18
# File 'lib/jrf/cli/runner.rb', line 15

def initialize
  @buf = +""
  @offset = 0
end

Instance Method Details

#append(chunk) ⇒ Object



20
21
22
# File 'lib/jrf/cli/runner.rb', line 20

def append(chunk)
  @buf << chunk
end

#each_payloadObject



24
25
26
27
28
# File 'lib/jrf/cli/runner.rb', line 24

def each_payload
  while (payload = next_payload)
    yield payload
  end
end

#has_partial?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/jrf/cli/runner.rb', line 30

def has_partial?
  @offset != @buf.bytesize
end