Class: Approvals::Writers::JsonWriter

Inherits:
TextWriter
  • Object
show all
Defined in:
lib/approvals/writers/json_writer.rb

Instance Method Summary collapse

Methods inherited from TextWriter

#write

Instance Method Details

#extensionObject



5
6
7
# File 'lib/approvals/writers/json_writer.rb', line 5

def extension
  'json'
end

#format(data) ⇒ Object



9
10
11
# File 'lib/approvals/writers/json_writer.rb', line 9

def format(data)
  JSON.pretty_generate(JSON.parse(data))
end