Class: Fi::File

Inherits:
File
  • Object
show all
Defined in:
lib/fi/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, content = '') ⇒ File

Returns a new instance of File.



3
4
5
6
7
8
# File 'lib/fi/file.rb', line 3

def initialize(path, content='')
  @path = path
  ::File.open(@path, 'w+') do |f|
    f.write content
  end
end

Instance Method Details

#contentObject



10
11
12
# File 'lib/fi/file.rb', line 10

def content
  Fi.read @path
end