better attachment api

This commit is contained in:
Chris Anderson 2008-06-07 09:05:29 -07:00
parent b350a51963
commit 881b18b0f0

View file

@ -63,14 +63,10 @@ class CouchRest
end
private
def encode_attachments attachments
result = {}
attachments.each do |k,v|
result[k] = {
"type" => v['type'],
"data" => base64(v['data'])
}
v['data'] = base64(v['data'])
end
result
attachments
end
def base64 data
Base64.encode64(data).gsub(/\s/,'')