Class: Azure::Core::Http::HttpResponse::MockResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/azure/core/http/http_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject

Returns the value of attribute body.



123
124
125
# File 'lib/azure/core/http/http_response.rb', line 123

def body
  @body
end

#codeObject

Returns the value of attribute code.



122
123
124
# File 'lib/azure/core/http/http_response.rb', line 122

def code
  @code
end

#headersObject

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_hashObject



126
127
128
# File 'lib/azure/core/http/http_response.rb', line 126

def to_hash
  @headers
end