Class: File

Inherits:
Object show all
Defined in:
lib/core/file.rb

Class Method Summary collapse

Class Method Details

.string_to_file(string, file) ⇒ Object

Writes string to file.



8
9
10
# File 'lib/core/file.rb', line 8

def self.string_to_file(string,file)
  File.open(file,'w') {|f| f.write(string) }
end

.to_string(file) ⇒ Object

Converts file to string.



3
4
5
# File 'lib/core/file.rb', line 3

def self.to_string(file)
  IO.read(file)
end