Class: Clusters::Management::CreateProjectService

Inherits:
Object
  • Object
show all
Defined in:
app/services/clusters/management/create_project_service.rb

Constant Summary collapse

CreateError =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster, current_user:) ⇒ CreateProjectService

Returns a new instance of CreateProjectService.


10
11
12
13
# File 'app/services/clusters/management/create_project_service.rb', line 10

def initialize(cluster, current_user:)
  @cluster = cluster
  @current_user = current_user
end

Instance Attribute Details

#clusterObject (readonly)

Returns the value of attribute cluster


8
9
10
# File 'app/services/clusters/management/create_project_service.rb', line 8

def cluster
  @cluster
end

#current_userObject (readonly)

Returns the value of attribute current_user


8
9
10
# File 'app/services/clusters/management/create_project_service.rb', line 8

def current_user
  @current_user
end

Instance Method Details

#executeObject


15
16
17
18
19
20
# File 'app/services/clusters/management/create_project_service.rb', line 15

def execute
  return unless management_project_required?

  project = create_management_project!
  update_cluster!(project)
end