Class: AwsCftTools::TemplateSet
- Inherits:
-
Array
- Object
- Array
- AwsCftTools::TemplateSet
- Extended by:
- Forwardable
- Includes:
- ArrayMethods, Closure, Dependencies
- Defined in:
- lib/aws_cft_tools/template_set.rb,
lib/aws_cft_tools/template_set/closure.rb,
lib/aws_cft_tools/template_set/dependencies.rb,
lib/aws_cft_tools/template_set/array_methods.rb,
lib/aws_cft_tools/template_set/each_slice_state.rb
Overview
Management of a set of template sources.
Defined Under Namespace
Modules: ArrayMethods, Closure, Dependencies Classes: EachSliceState
Instance Attribute Summary collapse
-
#dependency_tree ⇒ Object
readonly
Returns the value of attribute dependency_tree.
-
#known_exports ⇒ Object
Returns the value of attribute known_exports.
Instance Method Summary collapse
- #defined_variables ⇒ Object
-
#dependencies_for(template) ⇒ AwsCftTools::TemplateSet
Set of templates on which the given template depends.
-
#dependents_for(template) ⇒ AwsCftTools::TemplateSet
Set of templates that depend on the given template.
-
#initialize(list = []) ⇒ TemplateSet
constructor
A new instance of TemplateSet.
-
#templates_for(filenames) ⇒ AwsCftTools::TemplateSet
Set of templates with the given filenames.
- #undefined_variables ⇒ Object
Methods included from Dependencies
#each_slice, #linked, #provided, #required
Methods included from Closure
#closed_subset, #closure, #filenames, #in_folder_order
Methods included from ArrayMethods
Constructor Details
#initialize(list = []) ⇒ TemplateSet
Returns a new instance of TemplateSet.
36 37 38 39 40 41 42 43 |
# File 'lib/aws_cft_tools/template_set.rb', line 36 def initialize(list = []) @dependency_tree = AwsCftTools::DependencyTree.new @sorted_names = [] @known_exports = [] super(list) list.each { |template| process_template_addition(template) } end |
Instance Attribute Details
#dependency_tree ⇒ Object (readonly)
Returns the value of attribute dependency_tree.
11 12 13 |
# File 'lib/aws_cft_tools/template_set.rb', line 11 def dependency_tree @dependency_tree end |
#known_exports ⇒ Object
Returns the value of attribute known_exports.
10 11 12 |
# File 'lib/aws_cft_tools/template_set.rb', line 10 def known_exports @known_exports end |
Instance Method Details
#defined_variables ⇒ Object
31 |
# File 'lib/aws_cft_tools/template_set.rb', line 31 def_delegators :dependency_tree, :undefined_variables, :defined_variables |
#dependencies_for(template) ⇒ AwsCftTools::TemplateSet
Returns set of templates on which the given template depends.
80 81 82 |
# File 'lib/aws_cft_tools/template_set.rb', line 80 def dependencies_for(template) templates_for(@dependency_tree.dependencies_for(template.filename.to_s)) end |
#dependents_for(template) ⇒ AwsCftTools::TemplateSet
Returns set of templates that depend on the given template.
88 89 90 |
# File 'lib/aws_cft_tools/template_set.rb', line 88 def dependents_for(template) templates_for(@dependency_tree.dependents_for(template.filename.to_s)) end |
#templates_for(filenames) ⇒ AwsCftTools::TemplateSet
Returns set of templates with the given filenames.
72 73 74 |
# File 'lib/aws_cft_tools/template_set.rb', line 72 def templates_for(filenames) select { |template| filenames.include?(template.filename.to_s) } end |
#undefined_variables ⇒ Object
31 |
# File 'lib/aws_cft_tools/template_set.rb', line 31 def_delegators :dependency_tree, :undefined_variables, :defined_variables |