add move and copy support to CouchRest::Document instances

This commit is contained in:
Matt Lyon 2009-01-16 01:07:37 -08:00 committed by Chris Anderson
parent 0519fc5765
commit a0a422b779
2 changed files with 95 additions and 0 deletions

View file

@ -56,6 +56,18 @@ module CouchRest
end
result['ok']
end
def copy(dest)
raise ArgumentError, "doc.database required to copy" unless database
result = database.copy(self, dest)
result['ok']
end
def move(dest)
raise ArgumentError, "doc.database required to copy" unless database
result = database.move(self, dest)
result['ok']
end
end