Class: Azure::Core::Http::HttpResponse::MockResponse
- Inherits:
-
Object
- Object
- Azure::Core::Http::HttpResponse::MockResponse
- Defined in:
- lib/azure/core/http/http_response.rb
Overview
TODO: This needs to be deleted and HttpError needs to be refactored to not rely on HttpResponse. The dependency on knowing the internal structure of HttpResponse breaks good design principles. The only reason this class exists is because the HttpError parses the HttpResponse to produce an error msg.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(code, body, headers) ⇒ MockResponse
constructor
A new instance of MockResponse.
- #to_hash ⇒ Object
Constructor Details
#initialize(code, body, headers) ⇒ MockResponse
Returns a new instance of MockResponse.
83 84 85 86 87 88 89 90 |
# File 'lib/azure/core/http/http_response.rb', line 83 def initialize(code, body, headers) @status = code @body = body @headers = headers @headers.each { |k,v| @headers[k] = [v] unless v.respond_to? 'first' } end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
92 93 94 |
# File 'lib/azure/core/http/http_response.rb', line 92 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
93 94 95 |
# File 'lib/azure/core/http/http_response.rb', line 93 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
91 92 93 |
# File 'lib/azure/core/http/http_response.rb', line 91 def status @status end |
Instance Method Details
#to_hash ⇒ Object
95 96 97 |
# File 'lib/azure/core/http/http_response.rb', line 95 def to_hash @headers end |