Sha256: 8eae00fdb4bd330ff5471600fe950ebf1bd11c243e2f03e30cd2a3f069f5359c

Contents?: true

Size: 1.5 KB

Versions: 44

Compression:

Stored size: 1.5 KB

Contents

require_relative "base_decorator"
require_relative "timestamps"

module PactBroker
  module Api
    module Decorators
      class EnvironmentDecorator < BaseDecorator
        property :uuid, writeable: false
        property :name
        property :display_name, camelize: true
        property :production

        collection :contacts, class: OpenStruct do
          property :name
          property :details
        end

        include Timestamps

        link :self do | user_options |
          {
            title: "Environment",
            name: represented.name,
            href: environment_url(represented, user_options.fetch(:base_url))
          }
        end

        link :'pb:currently-deployed-deployed-versions' do | user_options |
          {
            title: "Versions currently deployed to #{represented.display_name} environment",
            href: currently_deployed_versions_for_environment_url(represented, user_options.fetch(:base_url))
          }
        end

        link :'pb:currently-supported-released-versions' do | user_options |
          {
            title: "Versions released and supported in #{represented.display_name} environment",
            href: currently_supported_versions_for_environment_url(represented, user_options.fetch(:base_url))
          }
        end

        link :'pb:environments' do | user_options |
          {
            title: "Environments",
            href: environments_url(user_options.fetch(:base_url))
          }
        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/api/decorators/environment_decorator.rb
pact_broker-2.111.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.109.1 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.109.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.108.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.107.1 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.107.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.106.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.105.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.104.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.103.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.102.2 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.102.1 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.102.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.101.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.100.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.99.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.98.0 lib/pact_broker/api/decorators/environment_decorator.rb
pact_broker-2.97.0 lib/pact_broker/api/decorators/environment_decorator.rb