lib/metatron/template.rb in metatron-0.1.9 vs lib/metatron/template.rb in metatron-0.2.0
- old
+ new
@@ -1,15 +1,23 @@
# frozen_string_literal: true
module Metatron
# Base class for templating Kubernetes resources
class Template
- attr_accessor :api_version, :label_namespace, :name
- attr_reader :kind
+ attr_accessor :api_version, :name
+ attr_reader :kind, :label_namespace
+ class << self
+ attr_writer :label_namespace
+
+ def label_namespace
+ @label_namespace ||= "metatron.therubyist.org"
+ end
+ end
+
def initialize(name)
@name = name
- @label_namespace = "metatron.therubyist.org"
+ @label_namespace = self.class.label_namespace
@api_version = "v1"
@kind = self.class.name.split("::").last
run_initializers
end