Module: ActiveResourceResponse::HttpResponse

Defined in:
lib/active_resource_response/http_response.rb

Instance Method Summary collapse

Instance Method Details

#cookiesObject



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/active_resource_response/http_response.rb', line 33

def cookies
  unless defined? @_active_resource_response_cookies
    @_active_resource_response_cookies = (self.headers[:set_cookie] || {}).inject({}) do |out, cookie_str|
      CGI::Cookie::parse(cookie_str).each do |key, cookie|
        out[key] = cookie.value.first unless ['expires', 'path'].include? key
      end
      out
    end
  end
  @_active_resource_response_cookies
end

#headersObject



26
27
28
29
30
31
# File 'lib/active_resource_response/http_response.rb', line 26

def headers
  unless defined? @_active_resource_response_headers
    @_active_resource_response_headers = symbolize_keys(to_hash)
  end
  @_active_resource_response_headers
end