Class: Puppet::Parser::AST::Branch Private

Inherits:
Puppet::Parser::AST show all
Includes:
Enumerable
Defined in:
lib/puppet/parser/ast/branch.rb

Overview

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.

The parent class of all AST objects that contain other AST objects. Everything but the really simple objects descend from this. It is important to note that Branch objects contain other AST objects only – if you want to contain values, use a descendent of the AST::Leaf class.

Constant Summary

Constants inherited from Puppet::Parser::AST

AST

Instance Attribute Summary collapse

Attributes inherited from Puppet::Parser::AST

#file, #line, #parent, #pos, #scope

Instance Method Summary collapse

Methods included from Enumerable

#uniq

Methods inherited from Puppet::Parser::AST

#evaluate, #inspect, #safeevaluate

Methods included from Util::MethodHelper

#requiredopts, #set_options, #symbolize_options

Methods included from Util::Errors

#adderrorcontext, #devfail, #error_context, #exceptwrap, #fail

Constructor Details

#initialize(arghash) ⇒ Branch

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 Branch.



15
16
17
18
# File 'lib/puppet/parser/ast/branch.rb', line 15

def initialize(arghash)
  super(arghash)
  @children ||= []
end

Instance Attribute Details

#childrenObject

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.



9
10
11
# File 'lib/puppet/parser/ast/branch.rb', line 9

def children
  @children
end

#pinObject

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.



9
10
11
# File 'lib/puppet/parser/ast/branch.rb', line 9

def pin
  @pin
end

Instance Method Details

#eachObject

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.



11
12
13
# File 'lib/puppet/parser/ast/branch.rb', line 11

def each
  @children.each { |child| yield child }
end