Module: CouchRest::JsonResponse

Defined in:
lib/couchrest/json_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



5
6
7
# File 'lib/couchrest/json_response.rb', line 5

def headers
  @headers
end

#rawObject

Returns the value of attribute raw.



5
6
7
# File 'lib/couchrest/json_response.rb', line 5

def raw
  @raw
end

Class Method Details

.create(body) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/couchrest/json_response.rb', line 6

def JsonResponse.create(body)
  result = JSON.parse(body)
  result.extend(JsonResponse)
  result.headers = body.headers
  result.raw = body.to_s
  result
end