Class: Docker::API::Stream::Raw

Inherits:
Object
  • Object
show all
Defined in:
lib/docker/api/stream.rb

Overview

Passes bytes straight through, for TTY-enabled streams and for raw archive downloads where there is no framing to undo.

Instance Method Summary collapse

Constructor Details

#initialize {|chunk| ... } ⇒ Raw

Returns a new instance of Raw.

Yield Parameters:

  • chunk (String)

Raises:

  • (ArgumentError)


127
128
129
130
131
# File 'lib/docker/api/stream.rb', line 127

def initialize(&block)
  raise ArgumentError, "Raw needs a block to yield chunks to" unless block

  @block = block
end

Instance Method Details

#<<(chunk) ⇒ self

Parameters:

  • chunk (String)

Returns:

  • (self)


135
136
137
138
# File 'lib/docker/api/stream.rb', line 135

def <<(chunk)
  @block.call(chunk)
  self
end