Class: PactBroker::Matrix::SelectorIgnorer

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/matrix/selector_ignorer.rb

Instance Method Summary collapse

Constructor Details

#initialize(resolved_ignore_selectors) ⇒ SelectorIgnorer

Returns a new instance of SelectorIgnorer.

Parameters:



19
20
21
# File 'lib/pact_broker/matrix/selector_ignorer.rb', line 19

def initialize(resolved_ignore_selectors)
  @resolved_ignore_selectors = resolved_ignore_selectors
end

Instance Method Details

#ignore_pacticipant?(pacticipant) ⇒ Boolean

Whether the pacticipant should be ignored if the verification results are missing/failed.

Parameters:

Returns:

  • (Boolean)


26
27
28
29
30
# File 'lib/pact_broker/matrix/selector_ignorer.rb', line 26

def ignore_pacticipant?(pacticipant)
  resolved_ignore_selectors.any? do | s |
    s.pacticipant_id == pacticipant.id && s.only_pacticipant_name_specified?
  end
end

#ignore_pacticipant_version?(pacticipant, version) ⇒ Boolean

Whether the pacticipant version should be ignored if the verification results are missing/failed.

Parameters:

Returns:

  • (Boolean)


36
37
38
39
40
# File 'lib/pact_broker/matrix/selector_ignorer.rb', line 36

def ignore_pacticipant_version?(pacticipant, version)
  resolved_ignore_selectors.any? do | s |
    s.pacticipant_id == pacticipant.id && (s.only_pacticipant_name_specified? || s.pacticipant_version_id == version.id)
  end
end