Class: CouchRest::Response
- Inherits:
-
Hash
- Object
- Hash
- CouchRest::Response
- Defined in:
- lib/couchrest/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #delete(key) ⇒ Object
-
#initialize(pkeys = {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(pkeys = {}) ⇒ Response
Returns a new instance of Response.
4 5 6 7 8 9 10 11 |
# File 'lib/couchrest/response.rb', line 4 def initialize(pkeys = {}) pkeys ||= {} pkeys.each do |k,v| self[k.to_s] = v end @headers = pkeys.respond_to?(:headers) ? pkeys.headers : {} @raw = pkeys.respond_to?(:raw) ? pkeys.raw : nil end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/couchrest/response.rb', line 3 def headers @headers end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
3 4 5 |
# File 'lib/couchrest/response.rb', line 3 def raw @raw end |
Instance Method Details
#[](key) ⇒ Object
21 22 23 |
# File 'lib/couchrest/response.rb', line 21 def [](key) super(key.to_s) end |
#[]=(key, value) ⇒ Object
13 14 15 |
# File 'lib/couchrest/response.rb', line 13 def []=(key, value) super(key.to_s, value) end |
#delete(key) ⇒ Object
17 18 19 |
# File 'lib/couchrest/response.rb', line 17 def delete(key) super(key.to_s) end |