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

Constructor Details

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

Class Method Details

._pcore_typeObject



2978
2979
2980
2981
2982
# File 'lib/puppet/pops/model/ast.rb', line 2978

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



2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
# File 'lib/puppet/pops/model/ast.rb', line 2990

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:



2984
2985
2986
2987
2988
# File 'lib/puppet/pops/model/ast.rb', line 2984

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