Class: Pages::VirtualDomain
- Inherits:
-
Object
- Object
- Pages::VirtualDomain
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/models/pages/virtual_domain.rb
Instance Method Summary collapse
- #certificate ⇒ Object
-
#initialize(projects:, trim_prefix: nil, domain: nil, namespace: nil) ⇒ VirtualDomain
constructor
A new instance of VirtualDomain.
- #key ⇒ Object
- #lookup_paths ⇒ Object
- #root_namespace_id ⇒ Object
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
#certificate ⇒ Object
14 15 16 |
# File 'app/models/pages/virtual_domain.rb', line 14 def certificate domain&.certificate end |
#key ⇒ Object
18 19 20 |
# File 'app/models/pages/virtual_domain.rb', line 18 def key domain&.key end |
#lookup_paths ⇒ Object
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_id ⇒ Object
22 23 24 |
# File 'app/models/pages/virtual_domain.rb', line 22 def root_namespace_id @namespace&.root_ancestor&.id end |