Class: Puppet::Pops::Model::UnlessExpression

Inherits:
IfExpression show all
Defined in:
lib/puppet/pops/model/ast.rb

Instance Attribute Summary

Attributes inherited from IfExpression

#else_expr, #test, #then_expr

Attributes inherited from Positioned

#length, #locator, #offset

Attributes inherited from PopsObject

#hash

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from IfExpression

#_pcore_init_hash, create, #eql?, from_asserted_hash, from_hash, #initialize

Methods inherited from Positioned

#_pcore_init_hash, create, #file, from_asserted_hash, from_hash, #initialize, #line, #pos

Methods inherited from PopsObject

#_pcore_init_hash, create, #eql?, from_asserted_hash, from_hash, #initialize, #to_s

Methods included from Types::PuppetObject

#_pcore_init_hash, #_pcore_type, #to_s

Constructor Details

This class inherits a constructor from Puppet::Pops::Model::IfExpression

Class Method Details

._pcore_typeObject


2911
2912
2913
2914
2915
# File 'lib/puppet/pops/model/ast.rb', line 2911

def self._pcore_type
  @_pcore_type ||= Types::PObjectType.new('Puppet::AST::UnlessExpression', {
    'parent' => IfExpression._pcore_type
  })
end

Instance Method Details

#_pcore_all_contents(path, &block) ⇒ Object


2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
# File 'lib/puppet/pops/model/ast.rb', line 2923

def _pcore_all_contents(path, &block)
  path << self
  unless @test.nil?
    block.call(@test, path)
    @test._pcore_all_contents(path, &block)
  end
  unless @then_expr.nil?
    block.call(@then_expr, path)
    @then_expr._pcore_all_contents(path, &block)
  end
  unless @else_expr.nil?
    block.call(@else_expr, path)
    @else_expr._pcore_all_contents(path, &block)
  end
  path.pop
end

#_pcore_contents {|@test| ... } ⇒ Object

Yields:


2917
2918
2919
2920
2921
# File 'lib/puppet/pops/model/ast.rb', line 2917

def _pcore_contents
  yield(@test) unless @test.nil?
  yield(@then_expr) unless @then_expr.nil?
  yield(@else_expr) unless @else_expr.nil?
end