Module: RefCheck

Included in:
Array, CfnDsl::JSONable, Hash
Defined in:
lib/cfndsl/RefCheck.rb

Instance Method Summary collapse

Instance Method Details

#ref_childrenObject



30
31
32
# File 'lib/cfndsl/RefCheck.rb', line 30

def ref_children
  return []
end

#references(refs) ⇒ Object

This module defines some methods for walking the reference tree of various objects.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cfndsl/RefCheck.rb', line 7

def references(refs)
  ##
  # Build up a set of references.
  #
  raise "Circular reference" if @_visited

  @_visited = true
  
  if( self.respond_to?(:get_references ) ) then
    self.get_references.each do |ref|
      refs[ref.to_s] = 1
    end
  end

  self.ref_children.each do |elem|
    elem.references(refs) if elem.respond_to?(:references)
  end

  @_visited = nil

  return refs
end