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 descendant 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 inherited from Puppet::Parser::AST

#evaluate, #inspect, #safeevaluate

Methods included from Util::Errors

#adderrorcontext, #devfail, #error_context, error_location, error_location_with_space, error_location_with_unknowns, #exceptwrap, #fail

Constructor Details

#initialize(children: [], **args) ⇒ 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.



17
18
19
20
# File 'lib/puppet/parser/ast/branch.rb', line 17

def initialize(children: [], **args)
  @children = children
  super(**args)
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.



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

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.



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

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.



13
14
15
# File 'lib/puppet/parser/ast/branch.rb', line 13

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