Skip to content

Commit

Permalink
docs: commenting matrix integration class
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed May 2, 2022
1 parent 115102c commit 2ccbb90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/pact_broker/matrix/integration.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

# Represents the integration relationship between a consumer and a provider in the context
# of a matrix or can-i-deploy query.
# If the required flag is set, then one of the pacticipants (consumers) specified in the HTTP query
# requires the provider. It would not be required if a provider was specified, and it had an
# integration with a consumer.
# If the required flag is set, then one of the pacticipants specified in the matrix query
# is a consumer and it requires the provider to be already deployed. An integration would not be required if a provider
# was specified, and it had an integration with a consumer, but that consumer wasn't deployed yet.
#

module PactBroker
module Matrix
class Integration

attr_reader :consumer_name, :consumer_id, :provider_name, :provider_id

def initialize consumer_id, consumer_name, provider_id, provider_name, required
def initialize(consumer_id, consumer_name, provider_id, provider_name, required)
@consumer_id = consumer_id
@consumer_name = consumer_name
@provider_id = provider_id
Expand Down
2 changes: 2 additions & 0 deletions lib/pact_broker/matrix/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def integrations_where_specified_selector_is_consumer(resolved_specified_selecto
end
end

# Why does the consumer equivalent of this method use the QuickRow distinct_integrations_for_selector_as_consumer
# while this method uses the Integration?
def integrations_where_specified_selector_is_provider(resolved_specified_selectors)
integrations_involving_specified_providers = PactBroker::Integrations::Integration
.where(provider_id: resolved_specified_selectors.collect(&:pacticipant_id))
Expand Down

0 comments on commit 2ccbb90

Please sign in to comment.