Sha256: 43b37ba75db3aff30ff1a0afbd0dcb14894822fcd634e200d9cae85290e4c198

Contents?: true

Size: 995 Bytes

Versions: 26

Compression:

Stored size: 995 Bytes

Contents

require 'pact_broker/api/pact_broker_urls'
require 'pact_broker/ui/helpers/url_helper'

module PactBroker
  module UI
    module ViewDomain
      class Relationship

        include PactBroker::Api::PactBrokerUrls

        def initialize relationship
          @relationship = relationship
        end

        def consumer_name
          @relationship.consumer_name
        end

        def provider_name
          @relationship.provider_name
        end

        def consumer_group_url
          Helpers::URLHelper.group_url consumer_name
        end

        def provider_group_url
          Helpers::URLHelper.group_url provider_name
        end

        def latest_pact_url
          "#{pactigration_base_url('', @relationship)}/latest"
        end

        def <=> other
          comp = consumer_name.downcase <=> other.consumer_name.downcase
          return comp unless comp == 0
          provider_name.downcase <=> other.provider_name.downcase
        end

      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
pact_broker-1.18.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.18.0.beta.1 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.17.2 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.17.1 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.17.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.16.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.15.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.14.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.13.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.12.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.11.2 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.11.1 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.11.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.10.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.9.3 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.9.2 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.9.1 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.9.0 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.9.0.rc1 lib/pact_broker/ui/view_models/relationship.rb
pact_broker-1.8.1 lib/pact_broker/ui/view_models/relationship.rb