Class: HttpStub::Server::Stub::Match::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/http_stub/server/stub/match/controller.rb

Instance Method Summary collapse

Instance Method Details

#last_match(request, logger) ⇒ Object


8
9
10
11
# File 'lib/http_stub/server/stub/match/controller.rb', line 8

def last_match(request, logger)
  result = request.session.last_match(request.parameters.slice(:method, :uri), logger)
  result ? HttpStub::Server::Response.ok(body: result.to_json) : HttpStub::Server::Response::NOT_FOUND
end

#matches(request) ⇒ Object


13
14
15
# File 'lib/http_stub/server/stub/match/controller.rb', line 13

def matches(request)
  request.session.matches
end

#misses(request) ⇒ Object


17
18
19
# File 'lib/http_stub/server/stub/match/controller.rb', line 17

def misses(request)
  request.session.misses
end