Class: Approvals::Writers::JsonWriter
- Inherits:
-
TextWriter
- Object
- TextWriter
- Approvals::Writers::JsonWriter
- Defined in:
- lib/approvals/writers/json_writer.rb
Instance Method Summary collapse
Methods inherited from TextWriter
Instance Method Details
#extension ⇒ Object
4 5 6 |
# File 'lib/approvals/writers/json_writer.rb', line 4 def extension 'json' end |
#format(data) ⇒ Object
8 9 10 11 12 |
# File 'lib/approvals/writers/json_writer.rb', line 8 def format(data) hash_or_array = filter(parse_data(data)) JSON.pretty_generate(hash_or_array) + "\n" end |