Class: Convection::Model::Template::ResourceCollection
- Inherits:
-
Object
- Object
- Convection::Model::Template::ResourceCollection
- Extended by:
- Forwardable
- Includes:
- DSL::Helpers, DSL::Template::Resource, Mixin::Conditional
- Defined in:
- lib/convection/model/template/resource_collection.rb
Overview
A collection of different Resources.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(name, parent, &definition) ⇒ ResourceCollection
constructor
A new instance of ResourceCollection.
- #resources ⇒ Object
- #run_definition ⇒ Object
Methods included from Mixin::Conditional
Methods included from DSL::Template::Resource
#_terraform_module_dir_to_flag, #_terraform_module_flag_to_dir, attach_resource, attach_resource_collection, resource_collection_dsl_methods, resource_dsl_methods
Methods included from DSL::Helpers
#camel_case, included, method_name, #screaming_snake_case, #snake_case
Methods included from DSL::IntrinsicFunctions
#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_import_value, #fn_not, #fn_or, #fn_ref, #fn_sub, #get_att, #get_azs, included, #join, mixers, #select
Constructor Details
#initialize(name, parent, &definition) ⇒ ResourceCollection
Returns a new instance of ResourceCollection.
27 28 29 30 31 32 |
# File 'lib/convection/model/template/resource_collection.rb', line 27 def initialize(name, parent, &definition) @definition = definition @name = name @parent = parent @template = parent.template end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/convection/model/template/resource_collection.rb', line 15 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
16 17 18 |
# File 'lib/convection/model/template/resource_collection.rb', line 16 def parent @parent end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
17 18 19 |
# File 'lib/convection/model/template/resource_collection.rb', line 17 def template @template end |
Class Method Details
.attach_to_dsl(dsl_name) ⇒ Object
22 23 24 |
# File 'lib/convection/model/template/resource_collection.rb', line 22 def attach_to_dsl(dsl_name) DSL::Template::Resource.attach_resource_collection(dsl_name, self) end |
Instance Method Details
#execute ⇒ Object
This method is in place to be overriden by subclasses.
35 36 |
# File 'lib/convection/model/template/resource_collection.rb', line 35 def execute end |
#resources ⇒ Object
42 43 44 |
# File 'lib/convection/model/template/resource_collection.rb', line 42 def resources @resources ||= Convection::Model::Collection.new end |
#run_definition ⇒ Object
38 39 40 |
# File 'lib/convection/model/template/resource_collection.rb', line 38 def run_definition instance_exec(&@definition) if @definition end |