aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/encoders/object.rb
blob: 0475967aee8cdace8f6511868268645c3467f5ba (plain) (blame)
1
2
3
4
5
6
7
8
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 to_json(options = {})
    ActiveSupport::JSON.encode(instance_values, options)
  end
end