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.
114 115 116 117 118 119 120 121 |
# File 'lib/azure/core/http/http_response.rb', line 114 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.
123 124 125 |
# File 'lib/azure/core/http/http_response.rb', line 123 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
122 123 124 |
# File 'lib/azure/core/http/http_response.rb', line 122 def code @code end |
#headers ⇒ Object
Returns the value of attribute headers.
124 125 126 |
# File 'lib/azure/core/http/http_response.rb', line 124 def headers @headers end |
Instance Method Details
#to_hash ⇒ Object
126 127 128 |
# File 'lib/azure/core/http/http_response.rb', line 126 def to_hash @headers end |