Class: Qiniu::Storage::FileData
- Inherits:
- 
      Object
      
        - Object
- Qiniu::Storage::FileData
 
- Defined in:
- lib/qiniu/resumable_upload.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.
| 75 76 77 | # File 'lib/qiniu/resumable_upload.rb', line 75 def initialize(fh) @fh = fh end | 
Instance Attribute Details
#fh ⇒ Object
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_size ⇒ Object
| 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 | 
#mtime ⇒ Object
| 88 89 90 | # File 'lib/qiniu/resumable_upload.rb', line 88 def mtime @fh.mtime end | 
#path ⇒ Object
| 85 86 87 | # File 'lib/qiniu/resumable_upload.rb', line 85 def path @fh.path end |