Class: Swineherd::LocalFileSystem::LocalFile

Inherits:
Object
  • Object
show all
Defined in:
lib/swineherd/filesystem/localfilesystem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#handleObject

Returns the value of attribute handle.



60
61
62
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 60

def handle
  @handle
end

#modeObject

Returns the value of attribute mode.



60
61
62
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 60

def mode
  @mode
end

#pathObject

Returns the value of attribute path.



60
61
62
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 60

def path
  @path
end

#schemeObject

Returns the value of attribute scheme.



60
61
62
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 60

def scheme
  @scheme
end

Instance Method Details

#closeObject



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

#readObject



72
73
74
# File 'lib/swineherd/filesystem/localfilesystem.rb', line 72

def read
  @handle.read
end

#readlineObject



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