Class: KubernetesTemplateRendering::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/kubernetes_template_rendering/resource.rb

Defined Under Namespace

Classes: UnexpectedFileTypeError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_path:, definitions_path:, variables:, output_directory:, output_filename: nil) ⇒ Resource

Returns a new instance of Resource.



14
15
16
17
18
19
20
# File 'lib/kubernetes_template_rendering/resource.rb', line 14

def initialize(template_path:, definitions_path:, variables:, output_directory:, output_filename: nil)
  @template_path    = template_path
  @definitions_path = definitions_path
  @variables        = variables
  @output_directory = output_directory
  @output_filename  = output_filename || template_filename(template_path)
end

Instance Attribute Details

#output_directoryObject (readonly)

Returns the value of attribute output_directory.



12
13
14
# File 'lib/kubernetes_template_rendering/resource.rb', line 12

def output_directory
  @output_directory
end

#template_pathObject (readonly)

Returns the value of attribute template_path.



12
13
14
# File 'lib/kubernetes_template_rendering/resource.rb', line 12

def template_path
  @template_path
end

#variablesObject (readonly)

Returns the value of attribute variables.



12
13
14
# File 'lib/kubernetes_template_rendering/resource.rb', line 12

def variables
  @variables
end

Instance Method Details

#render(args) ⇒ Object



22
23
24
# File 'lib/kubernetes_template_rendering/resource.rb', line 22

def render(args)
  write_template(args)
end