Class: PactBroker::Matrix::ResolvedSelectorBuilder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unresolved_selector, selector_type, selector_ignorer) ⇒ ResolvedSelectorBuilder

Returns a new instance of ResolvedSelectorBuilder.

Parameters:



15
16
17
18
19
# File 'lib/pact_broker/matrix/resolved_selector_builder.rb', line 15

def initialize(unresolved_selector, selector_type, selector_ignorer)
  @unresolved_selector = unresolved_selector
  @selector_type = selector_type
  @selector_ignorer = selector_ignorer
end

Instance Attribute Details

#pacticipantObject

Returns the value of attribute pacticipant.



10
11
12
# File 'lib/pact_broker/matrix/resolved_selector_builder.rb', line 10

def pacticipant
  @pacticipant
end

#versionsObject

Returns the value of attribute versions.



10
11
12
# File 'lib/pact_broker/matrix/resolved_selector_builder.rb', line 10

def versions
  @versions
end

Instance Method Details

#buildObject



21
22
23
24
25
26
27
28
29
# File 'lib/pact_broker/matrix/resolved_selector_builder.rb', line 21

def build
  if pacticipant && versions
    build_resolved_selectors_for_versions(pacticipant, versions, unresolved_selector, selector_type)
  elsif pacticipant
    selector_for_all_versions_of_a_pacticipant(pacticipant, unresolved_selector, selector_type)
  else
    build_selector_for_non_existing_pacticipant(unresolved_selector, selector_type)
  end
end