aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/lib/active_support/json/encoders/object.rb
blob: 57603bd1e60de429bc532ee17f1b8947992f7e70 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                           
            
                                                                                      
                                  
                                                        
     

                             
   
require 'active_support/core_ext/object/instance_variables'

class Object
  # Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
  def rails_to_json(options = nil)
    ActiveSupport::JSON.encode(instance_values, options)
  end

  alias to_json rails_to_json
end