Class: Blanket::Writer
- Inherits:
-
Object
- Object
- Blanket::Writer
- Defined in:
- lib/blanket/config/writer.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Writer
constructor
A new instance of Writer.
- #write(path) ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Writer
Returns a new instance of Writer.
3 4 5 |
# File 'lib/blanket/config/writer.rb', line 3 def initialize(attributes) @attributes = attributes end |
Instance Method Details
#write(path) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/blanket/config/writer.rb', line 7 def write(path) File.delete(path) if File.exist?(path) write_to = File.new(path, File::CREAT, 0644) File.open(path, "w") do |out| YAML.dump(@attributes, out) end end |