Class: Pact::Consumer::MockServiceAdministrationEndpoint

Inherits:
Object
  • Object
show all
Includes:
RackRequestHelper
Defined in:
lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb

Constant Summary

Constants included from RackRequestHelper

RackRequestHelper::REQUEST_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RackRequestHelper

#params_hash, #request_as_hash_from

Constructor Details

#initialize(name, logger) ⇒ MockServiceAdministrationEndpoint

Returns a new instance of MockServiceAdministrationEndpoint.



8
9
10
11
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 8

def initialize name, logger
  @name = name
  @logger = logger
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 6

def logger
  @logger
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 6

def name
  @name
end

Instance Method Details

#match?(env) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 15

def match? env
  headers_from(env)['X-Pact-Mock-Service'] &&
  env['REQUEST_PATH'] == request_path &&
    env['REQUEST_METHOD'] == request_method
end

#request_methodObject

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 25

def request_method
  raise NotImplementedError
end

#request_pathObject

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 21

def request_path
  raise NotImplementedError
end