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


3101
3102
3103
3104
3105
# File 'lib/puppet/pops/model/ast.rb', line 3101

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


3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
# File 'lib/puppet/pops/model/ast.rb', line 3113

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:


3107
3108
3109
3110
3111
# File 'lib/puppet/pops/model/ast.rb', line 3107

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