Class: Chef::CookbookSiteStreamingUploader::StringPart

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

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ StringPart

Returns a new instance of StringPart.



180
181
182
# File 'lib/chef/cookbook_site_streaming_uploader.rb', line 180

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



189
190
191
# File 'lib/chef/cookbook_site_streaming_uploader.rb', line 189

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

#sizeObject



184
185
186
# File 'lib/chef/cookbook_site_streaming_uploader.rb', line 184

def size
  @str.length
end