class HttpStub::Server::Stub::Match::Match
Attributes
request[R]
response[R]
stub[R]
Public Class Methods
new(request, response, stub)
click to toggle source
# File lib/http_stub/server/stub/match/match.rb, line 10 def initialize(request, response, stub) @request = request @response = response @stub = stub end
Public Instance Methods
matches?(criteria, _logger)
click to toggle source
# File lib/http_stub/server/stub/match/match.rb, line 16 def matches?(criteria, _logger) @request.uri.include?(criteria[:uri]) && @request.method.casecmp(criteria[:method]).zero? end
to_json(*args)
click to toggle source
# File lib/http_stub/server/stub/match/match.rb, line 20 def to_json(*args) { request: @request, response: @response, stub: @stub }.to_json(*args) end