summaryrefslogtreecommitdiff
path: root/app/models/pages/virtual_domain.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/pages/virtual_domain.rb')
-rw-r--r--app/models/pages/virtual_domain.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/app/models/pages/virtual_domain.rb b/app/models/pages/virtual_domain.rb
new file mode 100644
index 00000000000..3a876dc06a2
--- /dev/null
+++ b/app/models/pages/virtual_domain.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module Pages
+ class VirtualDomain
+ def initialize(projects, domain: nil)
+ @projects = projects
+ @domain = domain
+ end
+
+ def certificate
+ domain&.certificate
+ end
+
+ def key
+ domain&.key
+ end
+
+ def lookup_paths
+ projects.map do |project|
+ project.pages_lookup_path(domain: domain)
+ end.sort_by(&:prefix).reverse
+ end
+
+ private
+
+ attr_reader :projects, :domain
+ end
+end