Class: Swineherd::BaseFileSystem::BaseFile
- Inherits:
- 
      Object
      
        - Object
- Swineherd::BaseFileSystem::BaseFile
 
- Defined in:
- lib/swineherd/filesystem/basefilesystem.rb
Instance Attribute Summary collapse
- 
  
    
      #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(*args)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Close the file. 
- 
  
    
      #initialize(*args, &blk)  ⇒ BaseFile 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of BaseFile. 
- 
  
    
      #open(path, mode = "r", &blk)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    A new file in the filesystem needs to be instantiated with a path, a mode (read ‘r’ or write ‘w’). 
- 
  
    
      #read  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Return whole file and as a string. 
- 
  
    
      #readline  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Return a line from stream. 
- 
  
    
      #write(string)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Writes a string to the file. 
Constructor Details
#initialize(*args, &blk) ⇒ BaseFile
Returns a new instance of BaseFile.
| 93 94 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 93 def initialize *args, &blk end | 
Instance Attribute Details
#mode ⇒ Object
Returns the value of attribute mode.
| 90 91 92 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 90 def mode @mode end | 
#path ⇒ Object
Returns the value of attribute path.
| 90 91 92 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 90 def path @path end | 
#scheme ⇒ Object
Returns the value of attribute scheme.
| 90 91 92 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 90 def scheme @scheme end | 
Instance Method Details
#close(*args) ⇒ Object
Close the file
| 124 125 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 124 def close *args end | 
#open(path, mode = "r", &blk) ⇒ Object
A new file in the filesystem needs to be instantiated with a path, a mode (read ‘r’ or write ‘w’).
| 100 101 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 100 def open path, mode="r", &blk end | 
#read ⇒ Object
Return whole file and as a string
| 106 107 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 106 def read end | 
#readline ⇒ Object
Return a line from stream
| 112 113 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 112 def readline end | 
#write(string) ⇒ Object
Writes a string to the file
| 118 119 | # File 'lib/swineherd/filesystem/basefilesystem.rb', line 118 def write string end |