method

to_json

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ToJsonWithActiveSupportEncoder
to_json(options = nil) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/core_ext/object/json.rb, line 36
    def to_json(options = nil)
      if options.is_a?(::JSON::State)
        # Called from JSON.{generate,dump}, forward it to JSON gem's to_json
        super(options)
      else
        # to_json is being invoked directly, use ActiveSupport's encoder
        ActiveSupport::JSON.encode(self, options)
      end
    end
Register or log in to add new notes.