debian-mirror-gitlab/app/services/clusters/build_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
509 B
Ruby
Raw Permalink Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Clusters
class BuildService
def initialize(subject)
@subject = subject
end
def execute
::Clusters::Cluster.new.tap do |cluster|
case @subject
when ::Project
cluster.cluster_type = :project_type
when ::Group
cluster.cluster_type = :group_type
2019-07-31 22:56:46 +05:30
when Instance
cluster.cluster_type = :instance_type
2019-02-15 15:39:39 +05:30
else
raise NotImplementedError
end
end
end
end
end