Class: Qiniu::RS::UP::FileData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fh) ⇒ FileData

Returns a new instance of FileData.



123
124
125
# File 'lib/qiniu/rs/up.rb', line 123

def initialize(fh)
    @fh = fh
end

Instance Attribute Details

#fhObject

Returns the value of attribute fh.



122
123
124
# File 'lib/qiniu/rs/up.rb', line 122

def fh
  @fh
end

Instance Method Details

#data_sizeObject



126
127
128
# File 'lib/qiniu/rs/up.rb', line 126

def data_size
    @fh.stat.size
end

#get_data(offset, length) ⇒ Object



129
130
131
132
# File 'lib/qiniu/rs/up.rb', line 129

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

#mtimeObject



136
137
138
# File 'lib/qiniu/rs/up.rb', line 136

def mtime
    @fh.mtime
end

#pathObject



133
134
135
# File 'lib/qiniu/rs/up.rb', line 133

def path
    @fh.path
end