Class: UffizziCore::Api::Cli::V1::ProjectSerializer

Inherits:
BaseSerializer
  • Object
show all
Defined in:
app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb

Instance Method Summary collapse

Instance Method Details

#default_composeObject



14
15
16
# File 'app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb', line 14

def default_compose
  object.compose_files.main.first
end

#deploymentsObject



18
19
20
21
22
23
# File 'app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb', line 18

def deployments
  object.deployments.active.map do |deployment|
    deployment.state = UffizziCore::DeploymentService.failed?(deployment) ? 'failed' : 'active'
    deployment
  end
end

#secretsObject



25
26
27
28
29
# File 'app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb', line 25

def secrets
  return [] unless object.secrets

  object.secrets.map(&:name)
end