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.



34
35
36
37
# File 'lib/jrf/cli/runner.rb', line 34

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

Instance Method Details

#append(chunk) ⇒ Object



39
40
41
# File 'lib/jrf/cli/runner.rb', line 39

def append(chunk)
  @buf << chunk
end

#each_payloadObject



43
44
45
46
47
# File 'lib/jrf/cli/runner.rb', line 43

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

#has_partial?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/jrf/cli/runner.rb', line 49

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