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.
55 56 57 58 59 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 55 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.
53 54 55 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 53 def handle @handle end |
#mode ⇒ Object
Returns the value of attribute mode.
53 54 55 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 53 def mode @mode end |
#path ⇒ Object
Returns the value of attribute path.
53 54 55 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 53 def path @path end |
#scheme ⇒ Object
Returns the value of attribute scheme.
53 54 55 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 53 def scheme @scheme end |
Instance Method Details
#close ⇒ Object
77 78 79 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 77 def close @handle.close end |
#open(path, mode = "r", &blk) ⇒ Object
61 62 63 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 61 def open path, mode="r", &blk initialize(path,mode,&blk) end |
#read ⇒ Object
65 66 67 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 65 def read @handle.read end |
#readline ⇒ Object
69 70 71 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 69 def readline @handle.gets end |
#write(string) ⇒ Object
73 74 75 |
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 73 def write string @handle.write(string) end |