Sha256: a133667ce8b829b53f0c4088077c9780b5bb2fee90291cacb77265ff5e059bbd

Contents?: true

Size: 901 Bytes

Versions: 44

Compression:

Stored size: 901 Bytes

Contents

require "pact_broker/api/pact_broker_urls"
require "pact_broker/ui/helpers/url_helper"
require "pact_broker/date_helper"

module PactBroker
  module UI
    module ViewDomain
      class MatrixDeployedVersion
        include PactBroker::Api::PactBrokerUrls

        def initialize deployed_version
          @deployed_version = deployed_version
        end

        def environment_name
          deployed_version.environment.name
        end

        def tooltip
          "Currently deployed to #{deployed_version.environment.display_name} (#{relative_date(deployed_version.created_at)})"
        end

        def url
          hal_browser_url(deployed_version_url(deployed_version))
        end

        private

        attr_reader :deployed_version

        def relative_date date
          DateHelper.distance_of_time_in_words(date, DateTime.now) + " ago"
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
pact_broker-2.112.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.111.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.109.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.109.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.108.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.107.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.107.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.106.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.105.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.104.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.103.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.102.2 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.102.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.102.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.101.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.100.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.99.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.98.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.97.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb