Sha256: aec75d1d2e9483094563b6fff50cf650f033f525458f3e9408d1d207fd239668

Contents?: true

Size: 438 Bytes

Versions: 679

Compression:

Stored size: 438 Bytes

Contents

# Evaluates contained expressions, produce result of the last
#
class Puppet::Parser::AST::BlockExpression < Puppet::Parser::AST::Branch
  def evaluate(scope)
    @children.reduce(nil) { |_, child| child.safeevaluate(scope) }
  end

  def sequence_with(other)
    Puppet::Parser::AST::BlockExpression.new(:children => self.children + other.children)
  end

  def to_s
    "[" + @children.collect { |c| c.to_s }.join(', ') + "]"
  end
end

Version data entries

679 entries across 679 versions & 3 rubygems

Version Path
puppet-7.34.0 lib/puppet/parser/ast/block_expression.rb
puppet-7.34.0-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.34.0-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.34.0-universal-darwin lib/puppet/parser/ast/block_expression.rb
puppet-7.33.0 lib/puppet/parser/ast/block_expression.rb
puppet-7.33.0-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.33.0-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.33.0-universal-darwin lib/puppet/parser/ast/block_expression.rb
puppet-7.32.1 lib/puppet/parser/ast/block_expression.rb
puppet-7.32.1-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.32.1-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.32.1-universal-darwin lib/puppet/parser/ast/block_expression.rb
puppet-7.31.0 lib/puppet/parser/ast/block_expression.rb
puppet-7.31.0-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.31.0-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.31.0-universal-darwin lib/puppet/parser/ast/block_expression.rb
puppet-7.30.0 lib/puppet/parser/ast/block_expression.rb
puppet-7.30.0-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.30.0-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-7.30.0-universal-darwin lib/puppet/parser/ast/block_expression.rb