Class: RackDoubles::Middleware::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_doubles/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(responses, path) ⇒ Response

Returns a new instance of Response.



89
90
91
# File 'lib/rack_doubles/middleware.rb', line 89

def initialize(responses, path)
  @responses, @path = responses, path
end

Instance Method Details

#to_return(status, headers, body) ⇒ Object



93
94
95
# File 'lib/rack_doubles/middleware.rb', line 93

def to_return(status, headers, body)
  @responses[@path] = [status, headers, body]
end