extracted the response class to its own file

This commit is contained in:
Matt Aimonetti 2009-02-05 16:56:48 -08:00
parent 5d9e9fc53f
commit e9930c5a86
2 changed files with 16 additions and 0 deletions

View file

@ -29,6 +29,7 @@ module CouchRest
autoload :Server, 'couchrest/core/server' autoload :Server, 'couchrest/core/server'
autoload :Database, 'couchrest/core/database' autoload :Database, 'couchrest/core/database'
autoload :Response, 'couchrest/core/response'
autoload :Document, 'couchrest/core/document' autoload :Document, 'couchrest/core/document'
autoload :Design, 'couchrest/core/design' autoload :Design, 'couchrest/core/design'
autoload :View, 'couchrest/core/view' autoload :View, 'couchrest/core/view'

View file

@ -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