Class: FileSetWorks::LiveFile

Inherits:
Object
  • Object
show all
Defined in:
lib/fileset.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, filerep) ⇒ LiveFile

Returns a new instance of LiveFile.



5
6
7
8
# File 'lib/fileset.rb', line 5

def initialize(path, filerep)
  @path = path
  @rep = filerep
end

Instance Method Details

#contentsObject



22
23
24
# File 'lib/fileset.rb', line 22

def contents
  return @rep.contents
end

#contents=(new_contents) ⇒ Object



26
27
28
# File 'lib/fileset.rb', line 26

def contents=(new_contents)
  return @rep.contents=(new_contents)
end

#loadObject



10
11
12
13
14
# File 'lib/fileset.rb', line 10

def load
  ::File::open(@path, "r") do |file|
    @rep.load(file)
  end
end

#storeObject



16
17
18
19
20
# File 'lib/fileset.rb', line 16

def store
  ::File::open(@path, "w") do |file|
    @rep.store(file)
  end
end