Class: Pact::Consumer::InteractionsFilter
- Inherits:
-
Object
- Object
- Pact::Consumer::InteractionsFilter
- Defined in:
- lib/pact/consumer/interactions_filter.rb
Overview
TODO: think of a better word than filter
Direct Known Subclasses
Instance Method Summary collapse
- #index_of(interaction) ⇒ Object
-
#initialize(interactions = []) ⇒ InteractionsFilter
constructor
A new instance of InteractionsFilter.
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 |