Class: FileFM::StreamingUploader::StringPart

Inherits:
Object
  • Object
show all
Defined in:
lib/filefm/streaming_uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ StringPart

Returns a new instance of StringPart.



91
92
93
# File 'lib/filefm/streaming_uploader.rb', line 91

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



100
101
102
# File 'lib/filefm/streaming_uploader.rb', line 100

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

#sizeObject



95
96
97
# File 'lib/filefm/streaming_uploader.rb', line 95

def size
  @str.length
end