Class: PactBroker::Matrix::UnresolvedSelector
- Inherits:
-
Hash
- Object
- Hash
- PactBroker::Matrix::UnresolvedSelector
- Defined in:
- lib/pact_broker/matrix/unresolved_selector.rb
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
TODO rename branch to branch_name.
Instance Method Summary collapse
-
#all_for_pacticipant? ⇒ Boolean
rubocop: disable Metrics/CyclomaticComplexity.
- #branch ⇒ Object
- #branch=(branch) ⇒ Object
- #environment_name ⇒ Object
- #environment_name=(environment_name) ⇒ Object
-
#initialize(params = {}) ⇒ UnresolvedSelector
constructor
A new instance of UnresolvedSelector.
- #latest ⇒ Object
- #latest=(latest) ⇒ Object
- #latest? ⇒ Boolean
-
#latest_for_pacticipant_and_tag? ⇒ Boolean
rubocop: enable Metrics/CyclomaticComplexity.
- #main_branch ⇒ Boolean
- #main_branch=(main_branch) ⇒ Object
- #max_age ⇒ Object
-
#max_age=(max_age) ⇒ Object
TODO delete this once docker image uses new selector class for clean.
- #overall_latest? ⇒ Boolean
- #pacticipant_name ⇒ Object
- #pacticipant_name=(pacticipant_name) ⇒ Object
- #pacticipant_version_number ⇒ Object
- #pacticipant_version_number=(pacticipant_version_number) ⇒ Object
- #tag ⇒ Object
- #tag=(tag) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ UnresolvedSelector
Returns a new instance of UnresolvedSelector.
8 9 10 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 8 def initialize(params = {}) merge!(params) end |
Class Method Details
.from_hash(hash) ⇒ Object
TODO rename branch to branch_name
13 14 15 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 13 def self.from_hash(hash) new(hash.symbolize_keys.snakecase_keys.slice(:pacticipant_name, :pacticipant_version_number, :latest, :tag, :branch, :environment_name, :main_branch)) end |
Instance Method Details
#all_for_pacticipant? ⇒ Boolean
rubocop: disable Metrics/CyclomaticComplexity
93 94 95 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 93 def all_for_pacticipant? !!pacticipant_name && !pacticipant_version_number && !tag && !branch && !latest && !environment_name && !max_age && !main_branch end |
#branch ⇒ Object
41 42 43 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 41 def branch self[:branch] end |
#branch=(branch) ⇒ Object
62 63 64 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 62 def branch= branch self[:branch] = branch end |
#environment_name ⇒ Object
50 51 52 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 50 def environment_name self[:environment_name] end |
#environment_name=(environment_name) ⇒ Object
71 72 73 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 71 def environment_name= environment_name self[:environment_name] = environment_name end |
#latest ⇒ Object
33 34 35 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 33 def latest self[:latest] end |
#latest=(latest) ⇒ Object
54 55 56 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 54 def latest= latest self[:latest] = latest end |
#latest? ⇒ Boolean
25 26 27 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 25 def latest? !!latest end |
#latest_for_pacticipant_and_tag? ⇒ Boolean
rubocop: enable Metrics/CyclomaticComplexity
98 99 100 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 98 def latest_for_pacticipant_and_tag? !!(pacticipant_name && tag && latest) end |
#main_branch ⇒ Boolean
46 47 48 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 46 def main_branch self[:main_branch] end |
#main_branch=(main_branch) ⇒ Object
67 68 69 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 67 def main_branch= main_branch self[:main_branch] = main_branch end |
#max_age ⇒ Object
88 89 90 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 88 def max_age self[:max_age] end |
#max_age=(max_age) ⇒ Object
TODO delete this once docker image uses new selector class for clean
84 85 86 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 84 def max_age= max_age self[:max_age] = max_age end |
#overall_latest? ⇒ Boolean
29 30 31 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 29 def overall_latest? latest? && !tag && !branch end |
#pacticipant_name ⇒ Object
17 18 19 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 17 def pacticipant_name self[:pacticipant_name] end |
#pacticipant_name=(pacticipant_name) ⇒ Object
75 76 77 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 75 def pacticipant_name= pacticipant_name self[:pacticipant_name] = pacticipant_name end |
#pacticipant_version_number ⇒ Object
21 22 23 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 21 def pacticipant_version_number self[:pacticipant_version_number] end |
#pacticipant_version_number=(pacticipant_version_number) ⇒ Object
79 80 81 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 79 def pacticipant_version_number= pacticipant_version_number self[:pacticipant_version_number] = pacticipant_version_number end |
#tag ⇒ Object
37 38 39 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 37 def tag self[:tag] end |
#tag=(tag) ⇒ Object
58 59 60 |
# File 'lib/pact_broker/matrix/unresolved_selector.rb', line 58 def tag= tag self[:tag] = tag end |