Class: PactBroker::Verifications::RequiredVerification
- Inherits:
-
Object
- Object
- PactBroker::Verifications::RequiredVerification
- Defined in:
- lib/pact_broker/verifications/required_verification.rb
Instance Attribute Summary collapse
-
#provider_version ⇒ Object
readonly
Returns the value of attribute provider_version.
-
#provider_version_descriptions ⇒ Object
readonly
Returns the value of attribute provider_version_descriptions.
-
#provider_version_selectors ⇒ Object
readonly
Returns the value of attribute provider_version_selectors.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(attributes = {}) ⇒ RequiredVerification
constructor
A new instance of RequiredVerification.
Constructor Details
#initialize(attributes = {}) ⇒ RequiredVerification
Returns a new instance of RequiredVerification.
6 7 8 9 10 |
# File 'lib/pact_broker/verifications/required_verification.rb', line 6 def initialize(attributes = {}) attributes.each do | (name, value) | instance_variable_set("@#{name}", value) if respond_to?(name) end end |
Instance Attribute Details
#provider_version ⇒ Object (readonly)
Returns the value of attribute provider_version.
4 5 6 |
# File 'lib/pact_broker/verifications/required_verification.rb', line 4 def provider_version @provider_version end |
#provider_version_descriptions ⇒ Object (readonly)
Returns the value of attribute provider_version_descriptions.
4 5 6 |
# File 'lib/pact_broker/verifications/required_verification.rb', line 4 def provider_version_descriptions @provider_version_descriptions end |
#provider_version_selectors ⇒ Object (readonly)
Returns the value of attribute provider_version_selectors.
4 5 6 |
# File 'lib/pact_broker/verifications/required_verification.rb', line 4 def provider_version_selectors @provider_version_selectors end |
Instance Method Details
#+(other) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pact_broker/verifications/required_verification.rb', line 18 def + other if provider_version != other.provider_version raise PactBroker::Error.new("Can't + RequiredVerifications with different provider versions (#{provider_version.number}/#{other.provider_version.number})") end RequiredVerification.new( provider_version: provider_version, provider_version_selectors: provider_version_selectors + other.provider_version_selectors, provider_version_descriptions: (provider_version_descriptions + other.provider_version_descriptions).uniq ) end |
#==(other) ⇒ Object
12 13 14 15 16 |
# File 'lib/pact_broker/verifications/required_verification.rb', line 12 def == other provider_version == other.provider_version && provider_version_selectors == other.provider_version_selectors && provider_version_descriptions == other.provider_version_descriptions end |