Class: Pact::Consumer::MissingInteractionsGet

Inherits:
MockServiceAdministrationEndpoint show all
Includes:
RackRequestHelper
Defined in:
lib/pact/consumer/mock_service/missing_interactions_get.rb

Constant Summary

Constants included from RackRequestHelper

RackRequestHelper::REQUEST_KEYS

Instance Attribute Summary

Attributes inherited from MockServiceAdministrationEndpoint

#logger, #name

Instance Method Summary collapse

Methods included from RackRequestHelper

#params_hash, #request_as_hash_from

Methods inherited from MockServiceAdministrationEndpoint

#match?

Constructor Details

#initialize(name, logger, interaction_list) ⇒ MissingInteractionsGet

Returns a new instance of MissingInteractionsGet.



9
10
11
12
# File 'lib/pact/consumer/mock_service/missing_interactions_get.rb', line 9

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

Instance Method Details

#request_methodObject



18
19
20
# File 'lib/pact/consumer/mock_service/missing_interactions_get.rb', line 18

def request_method
  'GET'
end

#request_pathObject



14
15
16
# File 'lib/pact/consumer/mock_service/missing_interactions_get.rb', line 14

def request_path
  '/number_of_missing_interactions'
end

#respond(env) ⇒ Object



22
23
24
25
26
# File 'lib/pact/consumer/mock_service/missing_interactions_get.rb', line 22

def respond env
  number_of_missing_interactions = @interaction_list.missing_interactions.size
  logger.info "Number of missing interactions for mock \"#{name}\" = #{number_of_missing_interactions}"
  [200, {}, ["#{number_of_missing_interactions}"]]
end