Class: Chef::StreamingCookbookUploader::StringPart
- Defined in:
- lib/chef/streaming_cookbook_uploader.rb
Instance Method Summary collapse
-
#initialize(str) ⇒ StringPart
constructor
A new instance of StringPart.
-
#read(offset, how_much) ⇒ Object
read the specified amount from the string startiung at the offset.
- #size ⇒ Object
Constructor Details
#initialize(str) ⇒ StringPart
Returns a new instance of StringPart.
141 142 143 |
# File 'lib/chef/streaming_cookbook_uploader.rb', line 141 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
150 151 152 |
# File 'lib/chef/streaming_cookbook_uploader.rb', line 150 def read(offset, how_much) @str[offset, how_much] end |
#size ⇒ Object
145 146 147 |
# File 'lib/chef/streaming_cookbook_uploader.rb', line 145 def size @str.length end |