# File lib/dm-serializer/to_json.rb, line 47
    def to_json(*args)
      options = args.first || {}
      options = options.to_h if options.respond_to?(:to_h)

      result = as_json(options)

      # default to making JSON
      if options.fetch(:to_json, true)
        result.to_json
      else
        result
      end
    end