Class: Puppet::Pops::Containment::EAllContainersEnumerator Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/puppet/pops/containment.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(o) ⇒ EAllContainersEnumerator

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EAllContainersEnumerator.



20
21
22
# File 'lib/puppet/pops/containment.rb', line 20

def initialize o
  @element = o
end

Instance Method Details

#each(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
# File 'lib/puppet/pops/containment.rb', line 24

def each &block
  if block_given?
    eAllContainers(@element, &block)
  else
    self
  end
end

#eAllContainers(element, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
35
36
37
38
# File 'lib/puppet/pops/containment.rb', line 32

def eAllContainers(element, &block)
  x = element.eContainer
  while !x.nil? do
    yield x
    x = x.eContainer
  end
end