Class: Chef::StreamingCookbookUploader::StringPart

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

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ StringPart

Returns a new instance of StringPart.



140
141
142
# File 'lib/chef/streaming_cookbook_uploader.rb', line 140

def initialize(str)
  @str = str
end

Instance Method Details

#read(offset, how_much) ⇒ Object

read the specified amount from the string startiung at the offset



149
150
151
# File 'lib/chef/streaming_cookbook_uploader.rb', line 149

def read(offset, how_much)
  @str[offset, how_much]
end

#sizeObject



144
145
146
# File 'lib/chef/streaming_cookbook_uploader.rb', line 144

def size
  @str.length
end