# File lib/dm-serializer/to_json.rb, line 80
    def to_json(*args)
      options = args.first
      options = {} unless options.kind_of?(Hash)

      resource_options = options.merge(:to_json => false)
      collection = map { |resource| resource.to_json(resource_options) }

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