Class: RackStubs::Middleware::PathSpecification
- Inherits:
-
Object
- Object
- RackStubs::Middleware::PathSpecification
- Defined in:
- lib/rack_stubs/middleware.rb
Instance Method Summary collapse
-
#initialize(stubs, path, verb) ⇒ PathSpecification
constructor
A new instance of PathSpecification.
- #returns(status, headers, body) ⇒ Object
Constructor Details
#initialize(stubs, path, verb) ⇒ PathSpecification
Returns a new instance of PathSpecification.
42 43 44 |
# File 'lib/rack_stubs/middleware.rb', line 42 def initialize(stubs, path, verb) @stubs, @path, @verb = stubs, path, verb end |
Instance Method Details
#returns(status, headers, body) ⇒ Object
46 47 48 |
# File 'lib/rack_stubs/middleware.rb', line 46 def returns(status, headers, body) (@stubs[@path] ||= {})[@verb] = [status, headers, body] end |