Class: RightDevelop::Testing::Client::Rest::Request::Record::TimeoutNetHttpResponse
- Inherits:
-
Object
- Object
- RightDevelop::Testing::Client::Rest::Request::Record::TimeoutNetHttpResponse
- Defined in:
- lib/right_develop/testing/clients/rest/requests/record.rb
Overview
simulated 504 Net::HTTPResponse
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize ⇒ TimeoutNetHttpResponse
constructor
A new instance of TimeoutNetHttpResponse.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ TimeoutNetHttpResponse
Returns a new instance of TimeoutNetHttpResponse.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/right_develop/testing/clients/rest/requests/record.rb', line 41 def initialize = 'Timeout' @code = 504 @headers = { 'content-type' => 'text/plain', 'content-length' => ::Rack::Utils.bytesize().to_s, 'connection' => 'close', }.inject({}) do |h, (k, v)| h[k] = Array(v) # expected to be an array h end @body = end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
39 40 41 |
# File 'lib/right_develop/testing/clients/rest/requests/record.rb', line 39 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
39 40 41 |
# File 'lib/right_develop/testing/clients/rest/requests/record.rb', line 39 def code @code end |
Instance Method Details
#[](key) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/right_develop/testing/clients/rest/requests/record.rb', line 55 def [](key) if header = @headers[key.downcase] header.join(', ') else nil end end |
#to_hash ⇒ Object
63 |
# File 'lib/right_develop/testing/clients/rest/requests/record.rb', line 63 def to_hash; @headers; end |