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, variable_overrides: {}, source_repo: nil) ⇒ Resource

Returns a new instance of Resource.



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

def initialize(template_path:, definitions_path:, variables:, output_directory:, output_filename: nil, variable_overrides: {}, source_repo: nil)
  @template_path      = template_path
  @definitions_path   = definitions_path
  @variables          = variables
  @variable_overrides = variable_overrides
  @output_directory   = output_directory
  @source_repo        = source_repo
  @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

#source_repoObject (readonly)

Returns the value of attribute source_repo.



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

def source_repo
  @source_repo
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

#variable_overridesObject (readonly)

Returns the value of attribute variable_overrides.



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

def variable_overrides
  @variable_overrides
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



24
25
26
# File 'lib/kubernetes_template_rendering/resource.rb', line 24

def render(args)
  write_template(args)
end