Class: PKGWizard::StreamingUploader::StringPart

Inherits:
Object
  • Object
show all
Defined in:
lib/pkg-wizard/streaming_uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ StringPart

Returns a new instance of StringPart.



81
82
83
# File 'lib/pkg-wizard/streaming_uploader.rb', line 81

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



90
91
92
# File 'lib/pkg-wizard/streaming_uploader.rb', line 90

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

#sizeObject



85
86
87
# File 'lib/pkg-wizard/streaming_uploader.rb', line 85

def size
  @str.length
end