Class: PactBroker::Versions::ResolvedSelector

Inherits:
Pacts::ResolvedSelector show all
Defined in:
lib/pact_broker/versions/selector.rb

Constant Summary collapse

PROPERTY_NAMES =
PactBroker::Pacts::Selector::PROPERTY_NAMES + [:version, :resolved_branch_name]

Instance Method Summary collapse

Methods inherited from Pacts::ResolvedSelector

#<=>, #==, #consumer_version, #currently_deployed_comparison, #currently_supported_comparison, #environment, #production_comparison

Methods inherited from Pacts::Selector

#<=>, #==, all_for_tag, #all_for_tag?, all_for_tag_and_consumer, #all_for_tag_and_consumer?, #branch, #branch=, #consumer, #consumer=, #currently_deployed, #currently_deployed=, #currently_deployed?, #currently_supported, #currently_supported=, #currently_supported?, #environment_name, #environment_name=, #fallback_branch, #fallback_branch=, #fallback_branch?, #fallback_tag, #fallback_tag=, #fallback_tag?, #for_consumer, for_currently_deployed, for_currently_deployed_and_consumer, for_currently_deployed_and_environment_and_consumer, for_currently_supported, for_currently_supported_and_environment_and_consumer, for_environment, for_environment_and_consumer, for_main_branch, from_hash, #in_environment?, #latest, #latest=, latest_for_branch, #latest_for_branch?, latest_for_branch_and_consumer, latest_for_branch_with_fallback, latest_for_consumer, #latest_for_each_branch?, #latest_for_main_branch?, latest_for_tag, #latest_for_tag?, latest_for_tag_and_consumer, latest_for_tag_with_fallback, #main_branch, #main_branch=, #matching_branch, #matching_branch=, #matching_branch?, overall_latest, #overall_latest?, #resolve, #resolve_for_environment, #resolve_for_fallback, #tag, #tag=, #type

Constructor Details

#initialize(properties = {}, version) ⇒ ResolvedSelector

Returns a new instance of ResolvedSelector.



18
19
20
21
# File 'lib/pact_broker/versions/selector.rb', line 18

def initialize(properties = {}, version)
  properties.without(*PROPERTY_NAMES).tap { |it| warn("WARN: Unsupported property for #{self.class.name}: #{it.keys.join(", ")} at #{caller[0..3]}") if it.any? }
  merge!(properties.merge(version: version))
end

Instance Method Details

#resolved_branch_nameObject



23
24
25
# File 'lib/pact_broker/versions/selector.rb', line 23

def resolved_branch_name
  self[:resolved_branch_name]
end

#versionObject



27
28
29
# File 'lib/pact_broker/versions/selector.rb', line 27

def version
  self[:version]
end