Class: Pact::MockService::Interactions::InteractionsFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/mock_service/interactions/interactions_filter.rb

Overview

TODO: think of a better word than filter

Instance Method Summary collapse

Constructor Details

#initialize(interactions = []) ⇒ InteractionsFilter

Returns a new instance of InteractionsFilter.



28
29
30
# File 'lib/pact/mock_service/interactions/interactions_filter.rb', line 28

def initialize interactions = []
   @interactions = interactions
end

Instance Method Details

#index_of(interaction) ⇒ Object



32
33
34
# File 'lib/pact/mock_service/interactions/interactions_filter.rb', line 32

def index_of interaction
   @interactions.find_index{ |i| i.matches_criteria?(description: interaction.description, provider_state: interaction.provider_state)}
end