Class: Pact::MockService::Interactions::InteractionsFilter
- Inherits:
-
Object
- Object
- Pact::MockService::Interactions::InteractionsFilter
- Defined in:
- lib/pact/mock_service/interactions/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.
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 |