Class: RestMan::RawResponse
- Inherits:
-
Object
- Object
- RestMan::RawResponse
- Includes:
- AbstractResponse
- Defined in:
- lib/restman/raw_response.rb
Overview
:include: _doc/lib/restman/raw_response.rdoc
Instance Attribute Summary collapse
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
Attributes included from AbstractResponse
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(tempfile, net_http_res, request, start_time = nil) ⇒ RawResponse
constructor
:include: _doc/lib/restman/raw_response/new.rdoc.
- #inspect ⇒ Object
- #size ⇒ Object
- #to_s ⇒ Object
Methods included from AbstractResponse
beautify_headers, #code, #cookie_jar, #cookies, #description, #follow_get_redirection, #follow_redirection, #headers, #history, #log, #log_response, #raw_headers, #response_set_vars, #return!, #success?, #to_i
Constructor Details
#initialize(tempfile, net_http_res, request, start_time = nil) ⇒ RawResponse
:include: _doc/lib/restman/raw_response/new.rdoc
14 15 16 17 18 19 20 21 |
# File 'lib/restman/raw_response.rb', line 14 def initialize(tempfile, net_http_res, request, start_time=nil) @file = tempfile # reopen the tempfile so we can read it @file.open response_set_vars(net_http_res, request, start_time) end |
Instance Attribute Details
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
7 8 9 |
# File 'lib/restman/raw_response.rb', line 7 def end_time @end_time end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/restman/raw_response.rb', line 7 def file @file end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
7 8 9 |
# File 'lib/restman/raw_response.rb', line 7 def request @request end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
7 8 9 |
# File 'lib/restman/raw_response.rb', line 7 def start_time @start_time end |
Instance Method Details
#body ⇒ Object
27 28 29 30 |
# File 'lib/restman/raw_response.rb', line 27 def body @file.rewind @file.read end |
#inspect ⇒ Object
9 10 11 |
# File 'lib/restman/raw_response.rb', line 9 def inspect "<RestMan::RawResponse @code=#{code.inspect}, @file=#{file.inspect}, @request=#{request.inspect}>" end |
#size ⇒ Object
32 33 34 |
# File 'lib/restman/raw_response.rb', line 32 def size file.size end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/restman/raw_response.rb', line 23 def to_s body end |