Sha256: 66e449eac499230e0be3048626c128c529fc2cffbce215c2290a5f8095289fba

Contents?: true

Size: 469 Bytes

Versions: 12

Compression:

Stored size: 469 Bytes

Contents

# frozen_string_literal: true

# 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

12 entries across 12 versions & 1 rubygems

Version Path
puppet-8.5.1 lib/puppet/parser/ast/block_expression.rb
puppet-8.5.1-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-8.5.1-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-8.5.1-universal-darwin lib/puppet/parser/ast/block_expression.rb
puppet-8.5.0 lib/puppet/parser/ast/block_expression.rb
puppet-8.5.0-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-8.5.0-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-8.5.0-universal-darwin lib/puppet/parser/ast/block_expression.rb
puppet-8.4.0 lib/puppet/parser/ast/block_expression.rb
puppet-8.4.0-x86-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-8.4.0-x64-mingw32 lib/puppet/parser/ast/block_expression.rb
puppet-8.4.0-universal-darwin lib/puppet/parser/ast/block_expression.rb