From 9b3b56bbf546a33fccdc9a2b3432a3ee12907d1f Mon Sep 17 00:00:00 2001 From: Matt Lyon Date: Sun, 1 Feb 2009 23:34:30 -0800 Subject: [PATCH] documentation for Document#copy and #move, copied from Database --- lib/couchrest/core/document.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/couchrest/core/document.rb b/lib/couchrest/core/document.rb index 6fe5b77..dcd352a 100644 --- a/lib/couchrest/core/document.rb +++ b/lib/couchrest/core/document.rb @@ -57,12 +57,18 @@ module CouchRest result['ok'] end + # copies the document to a new id. If the destination id currently exists, a rev must be provided. + # dest can take one of two forms if overwriting: "id_to_overwrite?rev=revision" or the actual doc + # hash with a '_rev' key def copy(dest) raise ArgumentError, "doc.database required to copy" unless database result = database.copy(self, dest) result['ok'] end + # moves the document to a new id. If the destination id currently exists, a rev must be provided. + # dest can take one of two forms if overwriting: "id_to_overwrite?rev=revision" or the actual doc + # hash with a '_rev' key def move(dest) raise ArgumentError, "doc.database required to copy" unless database result = database.move(self, dest)