extracted the response class to its own file
This commit is contained in:
parent
5d9e9fc53f
commit
e9930c5a86
2 changed files with 16 additions and 0 deletions
|
@ -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'
|
||||
|
|
15
lib/couchrest/core/response.rb
Normal file
15
lib/couchrest/core/response.rb
Normal 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
|
Loading…
Reference in a new issue