Class: Pact::Consumer::MockServiceAdministrationEndpoint
- Inherits:
-
Object
- Object
- Pact::Consumer::MockServiceAdministrationEndpoint
- Includes:
- RackRequestHelper
- Defined in:
- lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb
Direct Known Subclasses
InteractionDelete, InteractionPost, LogGet, MissingInteractionsGet, VerificationGet
Constant Summary
Constants included from RackRequestHelper
RackRequestHelper::REQUEST_KEYS
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, logger) ⇒ MockServiceAdministrationEndpoint
constructor
A new instance of MockServiceAdministrationEndpoint.
- #match?(env) ⇒ Boolean
- #request_method ⇒ Object
- #request_path ⇒ Object
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
#logger ⇒ Object
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 |
#name ⇒ Object
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
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_method ⇒ Object
25 26 27 |
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 25 def request_method raise NotImplementedError end |
#request_path ⇒ Object
21 22 23 |
# File 'lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb', line 21 def request_path raise NotImplementedError end |