Class: RablRails::Renderers::JSON
- Defined in:
- lib/rabl-rails/renderers/json.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
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 = { [:root_name] => hash } if [:root_name] && RablRails.include_json_root MultiJson.encode(hash) end |