Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ezfile.rb
Instance Method Summary collapse
Instance Method Details
#to_file_ezfile(fpath = "file_" + Time.now.strftime("%y%m%s_%H%M%S") + ".txt") ⇒ Object
201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/ezfile.rb', line 201 def to_file_ezfile fpath = "file_" + Time.now.strftime("%y%m%s_%H%M%S") + ".txt" if File.exist?(fpath) puts "" return throw puts " ERROR ".light_white.on_red + " Destination Directory doesn't exist!" else f = File.new(fpath, "w") f.puts self f.close self end end |