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.



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

#bodyObject

Returns the value of attribute body.



130
131
132
# File 'lib/azure/core/http/http_response.rb', line 130

def body
  @body
end

#codeObject

Returns the value of attribute code.



129
130
131
# File 'lib/azure/core/http/http_response.rb', line 129

def code
  @code
end

#headersObject

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_hashObject



133
134
135
# File 'lib/azure/core/http/http_response.rb', line 133

def to_hash
  @headers
end