Class: Rufus::Jig::HttpResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/rufus/jig/http.rb,
lib/rufus/jig/adapters/em.rb,
lib/rufus/jig/adapters/patron.rb

Overview

Re-opening to adapt to Patron

Constant Summary collapse

NHR =
/^Net::HTTP/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(res) ⇒ HttpResponse

Returns a new instance of HttpResponse.



72
73
74
75
# File 'lib/rufus/jig/http.rb', line 72

def initialize(res)

  net_http_init(res)
end

Instance Attribute Details

#body ⇒ Object (readonly)

Returns the value of attribute body.



69
70
71
# File 'lib/rufus/jig/http.rb', line 69

def body
  @body
end

#headers ⇒ Object (readonly)

Returns the value of attribute headers.



69
70
71
# File 'lib/rufus/jig/http.rb', line 69

def headers
  @headers
end

#original ⇒ Object (readonly)

Returns the value of attribute original.



70
71
72
# File 'lib/rufus/jig/http.rb', line 70

def original
  @original
end

#status ⇒ Object (readonly)

Returns the value of attribute status.



69
70
71
# File 'lib/rufus/jig/http.rb', line 69

def status
  @status
end

Instance Method Details

#etag ⇒ Object



77
78
79
80
# File 'lib/rufus/jig/http.rb', line 77

def etag

  headers['ETag'] || headers['Etag'] || headers['etag']
end