Class: DevSuite::Utils::FileWriter::Writer::Json
- Inherits:
-
Base
- Object
- Construct::Component::Base
- Base
- DevSuite::Utils::FileWriter::Writer::Json
- Defined in:
- lib/dev_suite/utils/file_writer/writer/json.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#append, #append_array, #delete_key, #delete_lines, #initialize, #read, #update_key
Methods inherited from Construct::Component::Base
Constructor Details
This class inherits a constructor from DevSuite::Utils::FileWriter::Writer::Base
Instance Method Details
#write(content, pretty: false, backup: false) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/dev_suite/utils/file_writer/writer/json.rb', line 8 def write(content, pretty: false, backup: false) create_backup(path) if backup json_content = convert_to_json(content, pretty) AtomicWriter.new(path, json_content).write end |