Class: TerraformDSL::Module
- Inherits:
-
Object
- Object
- TerraformDSL::Module
- Defined in:
- lib/scout/terraform_dsl.rb
Overview
Module objects hold the identity of a module and its :name, and can be used to create references to its outputs to pass as inputs for another module
Defined Under Namespace
Classes: Output
Instance Attribute Summary collapse
-
#deployment ⇒ Object
Returns the value of attribute deployment.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, deployment) ⇒ Module
constructor
Create a new Module.
-
#method_missing(output) ⇒ Output
Construct output variable references to use on templates.
-
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
Any missing method call can be the name of an output.
-
#to_json(*_args) ⇒ String
Callback to produce the json content when we serialize variable values.
Constructor Details
#initialize(name, type, deployment) ⇒ Module
Create a new Module
53 54 55 56 57 |
# File 'lib/scout/terraform_dsl.rb', line 53 def initialize(name, type, deployment) @name = name @type = type @deployment = deployment end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#deployment ⇒ Object
Returns the value of attribute deployment.
18 19 20 |
# File 'lib/scout/terraform_dsl.rb', line 18 def deployment @deployment end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/scout/terraform_dsl.rb', line 18 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
18 19 20 |
# File 'lib/scout/terraform_dsl.rb', line 18 def type @type end |
Instance Method Details
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
Any missing method call can be the name of an output
69 70 71 |
# File 'lib/scout/terraform_dsl.rb', line 69 def respond_to_missing?(_method_name, _include_private = false) true end |
#to_json(*_args) ⇒ String
Callback to produce the json content when we serialize variable values. It becomes a reference to a Module itself, and can be used in depends_on statements
80 81 82 |
# File 'lib/scout/terraform_dsl.rb', line 80 def to_json(*_args) ['module', @name].join('.') end |