Class: Qiniu::RS::UP::FileData
- Inherits:
-
Object
- Object
- Qiniu::RS::UP::FileData
- Defined in:
- lib/qiniu/rs/up.rb
Instance Attribute Summary collapse
-
#fh ⇒ Object
Returns the value of attribute fh.
Instance Method Summary collapse
- #data_size ⇒ Object
- #get_data(offset, length) ⇒ Object
-
#initialize(fh) ⇒ FileData
constructor
A new instance of FileData.
- #mtime ⇒ Object
- #path ⇒ Object
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
#fh ⇒ Object
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_size ⇒ Object
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 |
#mtime ⇒ Object
136 137 138 |
# File 'lib/qiniu/rs/up.rb', line 136 def mtime @fh.mtime end |
#path ⇒ Object
133 134 135 |
# File 'lib/qiniu/rs/up.rb', line 133 def path @fh.path end |