Class: Qiniu::Storage::FileData

Inherits:
Object
  • Object
show all
Defined in:
lib/qiniu/resumable_upload.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fh) ⇒ FileData

Returns a new instance of FileData.



75
76
77
# File 'lib/qiniu/resumable_upload.rb', line 75

def initialize(fh)
    @fh = fh
end

Instance Attribute Details

#fhObject

Returns the value of attribute fh.



74
75
76
# File 'lib/qiniu/resumable_upload.rb', line 74

def fh
  @fh
end

Instance Method Details

#data_sizeObject



78
79
80
# File 'lib/qiniu/resumable_upload.rb', line 78

def data_size
    @fh.stat.size
end

#get_data(offset, length) ⇒ Object



81
82
83
84
# File 'lib/qiniu/resumable_upload.rb', line 81

def get_data(offset, length)
    @fh.seek(offset)
    @fh.read(length)
end

#mtimeObject



88
89
90
# File 'lib/qiniu/resumable_upload.rb', line 88

def mtime
    @fh.mtime
end

#pathObject



85
86
87
# File 'lib/qiniu/resumable_upload.rb', line 85

def path
    @fh.path
end