Class: Pact::MockService::RequestHandlers::BaseRequestHandler

Inherits:
Object
  • Object
show all
Includes:
Consumer::RackRequestHelper
Defined in:
lib/pact/mock_service/request_handlers/base_request_handler.rb

Constant Summary collapse

NOT_FOUND_RESPONSE =
[404, {}, []].freeze

Constants included from Consumer::RackRequestHelper

Consumer::RackRequestHelper::REQUEST_KEYS

Instance Method Summary collapse

Methods included from Consumer::RackRequestHelper

#params_hash, #request_as_hash_from

Instance Method Details

#call(env) ⇒ Object



16
17
18
# File 'lib/pact/mock_service/request_handlers/base_request_handler.rb', line 16

def call env
  match?(env) ? respond(env) : NOT_FOUND_RESPONSE
end

#match?(env) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/pact/mock_service/request_handlers/base_request_handler.rb', line 12

def match? env
  raise NotImplementedError
end