Class: Chef::StreamingCookbookUploader::StreamPart

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/streaming_cookbook_uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(stream, size) ⇒ StreamPart

Returns a new instance of StreamPart.



125
126
127
# File 'lib/chef/streaming_cookbook_uploader.rb', line 125

def initialize(stream, size)
  @stream, @size = stream, size
end

Instance Method Details

#read(offset, how_much) ⇒ Object

read the specified amount from the stream



134
135
136
# File 'lib/chef/streaming_cookbook_uploader.rb', line 134

def read(offset, how_much)
  @stream.read(how_much)
end

#sizeObject



129
130
131
# File 'lib/chef/streaming_cookbook_uploader.rb', line 129

def size
  @size
end