Class: RablRails::Renderers::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/rabl-rails/renderers/json.rb

Instance Attribute Summary

Attributes inherited from Base

#_options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #render

Constructor Details

This class inherits a constructor from RablRails::Renderers::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RablRails::Renderers::Base

Instance Method Details

#format_output(hash) ⇒ Object



4
5
6
7
# File 'lib/rabl-rails/renderers/json.rb', line 4

def format_output(hash)
  hash = { _options[:root_name] => hash } if _options[:root_name] && RablRails.include_json_root
  MultiJson.encode(hash)
end