Class: CMSScanner::Formatter::Json

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

Overview

JSON Formatter

Constant Summary

Constants inherited from Base

Base::ERB_SUPPORTS_KVARGS

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



9
10
11
# File 'app/formatters/json.rb', line 9

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