Class: Pact::Consumer::InteractionsFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/consumer/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.



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

def initialize interactions = []
   @interactions = interactions
end

Instance Method Details

#index_of(interaction) ⇒ Object



10
11
12
# File 'lib/pact/consumer/interactions_filter.rb', line 10

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