Class: Pebblebed::Http::Response
- Inherits:
-
Object
- Object
- Pebblebed::Http::Response
- Defined in:
- lib/pebblebed/http.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(easy) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(easy) ⇒ Response
Returns a new instance of Response.
41 42 43 44 45 46 |
# File 'lib/pebblebed/http.rb', line 41 def initialize(easy) @body = easy.body_str # We parse it ourselves because Curl::Easy fails when there's no text message @status = easy.header_str.scan(/HTTP\/\d\.\d\s(\d+)\s/).map(&:first).last.to_i @url = easy.url end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
48 49 50 |
# File 'lib/pebblebed/http.rb', line 48 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
48 49 50 |
# File 'lib/pebblebed/http.rb', line 48 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
48 49 50 |
# File 'lib/pebblebed/http.rb', line 48 def url @url end |