class MiniProxy::Stub::Response

MiniProxy stub response, so stubbed requests can return a custom response

Public Class Methods

new(headers:, body:) click to toggle source
# File lib/miniproxy/stub/response.rb, line 6
def initialize(headers:, body:)
  @body = body
  @headers = headers
end

Public Instance Methods

body() click to toggle source
# File lib/miniproxy/stub/response.rb, line 11
def body
  @body || ""
end
code() click to toggle source
# File lib/miniproxy/stub/response.rb, line 15
def code
  200
end
headers() click to toggle source
# File lib/miniproxy/stub/response.rb, line 19
def headers
  @headers || { "Content-Type" => "text/html" }
end