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.96.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.95.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.95.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.94.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.93.4 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.93.3 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.93.2 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.93.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.93.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.92.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.91.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.90.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.89.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.89.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.88.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.87.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.86.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.85.1 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.85.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb
pact_broker-2.84.0 lib/pact_broker/ui/view_models/matrix_deployed_version.rb