Method: Pathstring#save
- Defined in:
- lib/pathstring.rb
#save(content = nil) ⇒ Object
save file content, if we have a content and if the dirname path exists
92 93 94 95 |
# File 'lib/pathstring.rb', line 92 def save(content=nil) @content = content if content open('w') { |f| f.write @content } if dirname.exist? && !@content.nil? end |