Class: KubernetesTemplateRendering::Resource
- Inherits:
-
Object
- Object
- KubernetesTemplateRendering::Resource
- Defined in:
- lib/kubernetes_template_rendering/resource.rb
Defined Under Namespace
Classes: UnexpectedFileTypeError
Instance Attribute Summary collapse
-
#output_directory ⇒ Object
readonly
Returns the value of attribute output_directory.
-
#source_repo ⇒ Object
readonly
Returns the value of attribute source_repo.
-
#template_path ⇒ Object
readonly
Returns the value of attribute template_path.
-
#variable_overrides ⇒ Object
readonly
Returns the value of attribute variable_overrides.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(template_path:, definitions_path:, variables:, output_directory:, output_filename: nil, variable_overrides: {}, source_repo: nil) ⇒ Resource
constructor
A new instance of Resource.
- #render(args) ⇒ Object
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_directory ⇒ Object (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_repo ⇒ Object (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_path ⇒ Object (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_overrides ⇒ Object (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 |
#variables ⇒ Object (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 |