Class: Azure::Core::Http::HttpResponse::MockResponse
- Inherits:
-
Object
- Object
- Azure::Core::Http::HttpResponse::MockResponse
- Defined in:
- lib/azure/core/http/http_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#headers ⇒ Object
Returns the value of attribute headers.
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.
121 122 123 124 125 126 127 128 |
# File 'lib/azure/core/http/http_response.rb', line 121 def initialize(code, body, headers) @code = code.to_s @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.
130 131 132 |
# File 'lib/azure/core/http/http_response.rb', line 130 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
129 130 131 |
# File 'lib/azure/core/http/http_response.rb', line 129 def code @code end |
#headers ⇒ Object
Returns the value of attribute headers.
131 132 133 |
# File 'lib/azure/core/http/http_response.rb', line 131 def headers @headers end |
Instance Method Details
#to_hash ⇒ Object
133 134 135 |
# File 'lib/azure/core/http/http_response.rb', line 133 def to_hash @headers end |