Class: Swineherd::LocalFileSystem::LocalFile
- Inherits:
- 
      Object
      
        - Object
- Swineherd::LocalFileSystem::LocalFile
 
- Defined in:
- lib/swineherd/filesystem/localfilesystem.rb
Instance Attribute Summary collapse
- 
  
    
      #handle  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute handle. 
- 
  
    
      #mode  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute mode. 
- 
  
    
      #path  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute path. 
- 
  
    
      #scheme  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute scheme. 
Instance Method Summary collapse
- #close ⇒ Object
- 
  
    
      #initialize(path, mode = "r", &blk)  ⇒ LocalFile 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of LocalFile. 
- #open(path, mode = "r", &blk) ⇒ Object
- #read ⇒ Object
- #readline ⇒ Object
- #write(string) ⇒ Object
Constructor Details
#initialize(path, mode = "r", &blk) ⇒ LocalFile
Returns a new instance of LocalFile.
| 62 63 64 65 66 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 62 def initialize path, mode="r", &blk @path = path @mode = mode @handle = File.open(path,mode,&blk) end | 
Instance Attribute Details
#handle ⇒ Object
Returns the value of attribute handle.
| 60 61 62 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 60 def handle @handle end | 
#mode ⇒ Object
Returns the value of attribute mode.
| 60 61 62 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 60 def mode @mode end | 
#path ⇒ Object
Returns the value of attribute path.
| 60 61 62 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 60 def path @path end | 
#scheme ⇒ Object
Returns the value of attribute scheme.
| 60 61 62 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 60 def scheme @scheme end | 
Instance Method Details
#close ⇒ Object
| 84 85 86 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 84 def close @handle.close end | 
#open(path, mode = "r", &blk) ⇒ Object
| 68 69 70 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 68 def open path, mode="r", &blk initialize(path,mode,&blk) end | 
#read ⇒ Object
| 72 73 74 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 72 def read @handle.read end | 
#readline ⇒ Object
| 76 77 78 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 76 def readline @handle.gets end | 
#write(string) ⇒ Object
| 80 81 82 | # File 'lib/swineherd/filesystem/localfilesystem.rb', line 80 def write string @handle.write(string) end |