class PactBroker::Matrix::Integration
Attributes
Public Class Methods
Source
# File lib/pact_broker/matrix/integration.rb, line 22 def self.from_hash hash new( hash.fetch(:consumer_id), hash.fetch(:consumer_name), hash.fetch(:provider_id), hash.fetch(:provider_name), hash.fetch(:required) ) end
Source
# File lib/pact_broker/matrix/integration.rb, line 14 def initialize(consumer_id, consumer_name, provider_id, provider_name, required) @consumer_id = consumer_id @consumer_name = consumer_name @provider_id = provider_id @provider_name = provider_name @required = required end
Public Instance Methods
Source
# File lib/pact_broker/matrix/integration.rb, line 48 def <=> other comparison = consumer_name <=> other.consumer_name return comparison if comparison != 0 provider_name <=> other.provider_name end
Source
# File lib/pact_broker/matrix/integration.rb, line 44 def == other other.is_a?(Integration) && consumer_id == other.consumer_id && provider_id == other.provider_id && other.required? == required? end
Source
# File lib/pact_broker/matrix/integration.rb, line 32 def consumer @consumer ||= OpenStruct.new(name: consumer_name, id: consumer_id) end
Source
# File lib/pact_broker/matrix/integration.rb, line 71 def involves_consumer_with_id?(consumer_id) self.consumer_id == consumer_id end
Source
# File lib/pact_broker/matrix/integration.rb, line 83 def involves_consumer_with_name?(consumer_name) self.consumer_name == consumer_name end
Source
# File lib/pact_broker/matrix/integration.rb, line 75 def involves_consumer_with_names?(consumer_names) consumer_names.include?(self.consumer_name) end
Source
# File lib/pact_broker/matrix/integration.rb, line 87 def involves_pacticipant_with_name?(pacticipant_name) pacticipant_names.include?(pacticipant_name) end
Source
# File lib/pact_broker/matrix/integration.rb, line 79 def involves_provider_with_name?(provider_name) self.provider_name == provider_name end
Source
# File lib/pact_broker/matrix/integration.rb, line 91 def matches_pacticipant_ids?(other) consumer_id == other.consumer_id && provider_id == other.provider_id end
Source
# File lib/pact_broker/matrix/integration.rb, line 63 def pacticipant_names [consumer_name, provider_name] end
Source
# File lib/pact_broker/matrix/integration.rb, line 36 def provider @provider ||= OpenStruct.new(name: provider_name, id: provider_id) end
Source
# File lib/pact_broker/matrix/integration.rb, line 40 def required? @required end
Source
# File lib/pact_broker/matrix/integration.rb, line 54 def to_hash { consumer_name: consumer_name, consumer_id: consumer_id, provider_name: provider_name, provider_id: provider_id, } end
Source
# File lib/pact_broker/matrix/integration.rb, line 67 def to_s "Integration between #{consumer_name} (id=#{consumer_id}) and #{provider_name} (id=#{provider_id}) required=#{required?}" end