Class: PactBroker::Matrix::ErrorReasonWithTwoSelectors

Inherits:
ErrorReason show all
Defined in:
lib/pact_broker/matrix/reason.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ErrorReason

#type

Methods inherited from Reason

#type

Constructor Details

#initialize(consumer_selector, provider_selector) ⇒ ErrorReasonWithTwoSelectors

Returns a new instance of ErrorReasonWithTwoSelectors.



45
46
47
48
# File 'lib/pact_broker/matrix/reason.rb', line 45

def initialize(consumer_selector, provider_selector)
  @consumer_selector = consumer_selector
  @provider_selector = provider_selector
end

Instance Attribute Details

#consumer_selectorObject (readonly)

Returns the value of attribute consumer_selector.



43
44
45
# File 'lib/pact_broker/matrix/reason.rb', line 43

def consumer_selector
  @consumer_selector
end

#provider_selectorObject (readonly)

Returns the value of attribute provider_selector.



43
44
45
# File 'lib/pact_broker/matrix/reason.rb', line 43

def provider_selector
  @provider_selector
end

Instance Method Details

#==(other) ⇒ Object



50
51
52
53
54
# File 'lib/pact_broker/matrix/reason.rb', line 50

def == other
  super(other) &&
    consumer_selector == other.consumer_selector &&
    provider_selector == other.provider_selector
end

#selectorsObject



56
57
58
# File 'lib/pact_broker/matrix/reason.rb', line 56

def selectors
  [consumer_selector, provider_selector]
end

#to_sObject



60
61
62
# File 'lib/pact_broker/matrix/reason.rb', line 60

def to_s
  "#{self.class} consumer_selector=#{consumer_selector}, provider_selector=#{provider_selector}"
end