Sha256: 7d09cd54690cfb520b0937efcb0f9ac730b5006a57a458dc959c8f7341c4ff46

Contents?: true

Size: 714 Bytes

Versions: 3

Compression:

Stored size: 714 Bytes

Contents

module PactBroker
  module Api
    module PactBrokerUrls

      def base_url
        "http://localhost:1234"
      end

      def pacticipants_url
        "#{base_url}/pacticipants"
      end

      def pacticipant_url pacticipant
        "#{pacticipants_url}/#{url_encode(pacticipant.name)}"
      end

      def last_version_url pacticipant
        "#{pacticipant_url(pacticipant)}/versions/last"
      end

      def versions_url pacticipant
        "#{pacticipant_url(pacticipant)}/versions"
      end

      def version_url version
        "#{pacticipant_url(version.pacticipant)}/versions/#{version.number}"
      end

      def url_encode param
        ERB::Util.url_encode param
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pact_broker-0.0.4 lib/pact_broker/api/representors/pact_broker_urls.rb
pact_broker-0.0.3 lib/pact_broker/api/representors/pact_broker_urls.rb
pact_broker-0.0.2 lib/pact_broker/api/representors/pact_broker_urls.rb