Class: Mountebank::Stub::HttpResponse
- Defined in:
- lib/mountebank/stub/http_response.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Response
Class Method Summary collapse
Methods inherited from Response
#initialize, #to_json, with_injection
Constructor Details
This class inherits a constructor from Mountebank::Stub::Response
Class Method Details
.create(statusCode = 200, headers = {}, body = '') ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/mountebank/stub/http_response.rb', line 2 def self.create(statusCode=200, headers={}, body='') payload = {} payload[:statusCode] = statusCode payload[:headers] = headers unless headers.empty? payload[:body] = body unless body.empty? data = {is: payload} new(data) end |