Class: FileSetWorks::LiveFile
- Inherits:
-
Object
- Object
- FileSetWorks::LiveFile
- Defined in:
- lib/fileset.rb
Instance Method Summary collapse
- #contents ⇒ Object
- #contents=(new_contents) ⇒ Object
-
#initialize(path, filerep) ⇒ LiveFile
constructor
A new instance of LiveFile.
- #load ⇒ Object
- #store ⇒ Object
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
#contents ⇒ Object
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 |
#load ⇒ Object
10 11 12 13 14 |
# File 'lib/fileset.rb', line 10 def load ::File::open(@path, "r") do |file| @rep.load(file) end end |
#store ⇒ Object
16 17 18 19 20 |
# File 'lib/fileset.rb', line 16 def store ::File::open(@path, "w") do |file| @rep.store(file) end end |