Class: CMSScanner::Formatter::Json

Inherits:
Base
  • Object
show all
Includes:
Buffer
Defined in:
app/formatters/json.rb

Overview

JSON Formatter

Instance Attribute Summary

Attributes inherited from Base

#controller_name

Instance Method Summary collapse

Methods included from Buffer

#buffer, #output

Methods inherited from Base

#base_format, #format, #formats, #initialize, #output, #render, #template_vars, #user_interaction?, #view_path, #views_directories

Constructor Details

This class inherits a constructor from CMSScanner::Formatter::Base

Instance Method Details

#beautifyObject



7
8
9
# File 'app/formatters/json.rb', line 7

def beautify
  puts JSON.pretty_generate(JSON.parse("{#{buffer.chomp.chomp(',')}}"))
end