Class: Pages::VirtualDomain

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/models/pages/virtual_domain.rb

Instance Method Summary collapse

Constructor Details

#initialize(projects:, trim_prefix: nil, domain: nil, namespace: nil) ⇒ VirtualDomain

Returns a new instance of VirtualDomain.



7
8
9
10
11
12
# File 'app/models/pages/virtual_domain.rb', line 7

def initialize(projects:, trim_prefix: nil, domain: nil, namespace: nil)
  @projects = projects
  @trim_prefix = trim_prefix
  @domain = domain
  @namespace = namespace
end

Instance Method Details

#certificateObject



14
15
16
# File 'app/models/pages/virtual_domain.rb', line 14

def certificate
  domain&.certificate
end

#keyObject



18
19
20
# File 'app/models/pages/virtual_domain.rb', line 18

def key
  domain&.key
end

#lookup_pathsObject



26
27
28
# File 'app/models/pages/virtual_domain.rb', line 26

def lookup_paths
  projects.flat_map { |project| lookup_paths_for(project, root_namespace_id) }
end

#root_namespace_idObject



22
23
24
# File 'app/models/pages/virtual_domain.rb', line 22

def root_namespace_id
  @namespace&.root_ancestor&.id
end