From e9930c5a86ca5b172b6bf9b87378f820da1e4c08 Mon Sep 17 00:00:00 2001 From: Matt Aimonetti Date: Thu, 5 Feb 2009 16:56:48 -0800 Subject: [PATCH] extracted the response class to its own file --- lib/couchrest.rb | 1 + lib/couchrest/core/response.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 lib/couchrest/core/response.rb diff --git a/lib/couchrest.rb b/lib/couchrest.rb index 74a72a3..cffde30 100644 --- a/lib/couchrest.rb +++ b/lib/couchrest.rb @@ -29,6 +29,7 @@ module CouchRest autoload :Server, 'couchrest/core/server' autoload :Database, 'couchrest/core/database' + autoload :Response, 'couchrest/core/response' autoload :Document, 'couchrest/core/document' autoload :Design, 'couchrest/core/design' autoload :View, 'couchrest/core/view' diff --git a/lib/couchrest/core/response.rb b/lib/couchrest/core/response.rb new file mode 100644 index 0000000..7e3424b --- /dev/null +++ b/lib/couchrest/core/response.rb @@ -0,0 +1,15 @@ +module CouchRest + class Response < Hash + def initialize(keys = {}) + keys.each do |k,v| + self[k.to_s] = v + end + end + def []= key, value + super(key.to_s, value) + end + def [] key + super(key.to_s) + end + end +end \ No newline at end of file