class Puppet::Pops::Model::CallExpression

Attributes

arguments[R]
functor_expr[R]
lambda[R]
rval_required[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
2942 def self._pcore_type
2943   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CallExpression', {
2944     'parent' => Expression._pcore_type,
2945     'attributes' => {
2946       'rval_required' => {
2947         'type' => Types::PBooleanType::DEFAULT,
2948         'value' => false
2949       },
2950       'functor_expr' => Expression._pcore_type,
2951       'arguments' => {
2952         'type' => Types::PArrayType.new(Expression._pcore_type),
2953         'value' => []
2954       },
2955       'lambda' => {
2956         'type' => Types::POptionalType.new(Expression._pcore_type),
2957         'value' => nil
2958       }
2959     }
2960   })
2961 end
create(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2978 def self.create(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil)
2979   ta = Types::TypeAsserter
2980   attrs = _pcore_type.attributes(true)
2981   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2982   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2983   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2984   ta.assert_instance_of('Puppet::AST::CallExpression[rval_required]', attrs['rval_required'].type, rval_required)
2985   ta.assert_instance_of('Puppet::AST::CallExpression[functor_expr]', attrs['functor_expr'].type, functor_expr)
2986   ta.assert_instance_of('Puppet::AST::CallExpression[arguments]', attrs['arguments'].type, arguments)
2987   ta.assert_instance_of('Puppet::AST::CallExpression[lambda]', attrs['lambda'].type, lambda)
2988   new(locator, offset, length, functor_expr, rval_required, arguments, lambda)
2989 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2967 def self.from_asserted_hash(init_hash)
2968   new(
2969     init_hash['locator'],
2970     init_hash['offset'],
2971     init_hash['length'],
2972     init_hash['functor_expr'],
2973     init_hash.fetch('rval_required') { false },
2974     init_hash.fetch('arguments') { _pcore_type['arguments'].value },
2975     init_hash['lambda'])
2976 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2963 def self.from_hash(init_hash)
2964   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CallExpression initializer', _pcore_type.init_hash_type, init_hash))
2965 end
new(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
2996 def initialize(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil)
2997   super(locator, offset, length)
2998   @hash = @hash ^ rval_required.hash ^ functor_expr.hash ^ arguments.hash ^ lambda.hash
2999   @rval_required = rval_required
3000   @functor_expr = functor_expr
3001   @arguments = arguments
3002   @lambda = lambda
3003 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3020 def _pcore_all_contents(path, &block)
3021   path << self
3022   unless @functor_expr.nil?
3023     block.call(@functor_expr, path)
3024     @functor_expr._pcore_all_contents(path, &block)
3025   end
3026   @arguments.each do |value|
3027     block.call(value, path)
3028     value._pcore_all_contents(path, &block)
3029   end
3030   unless @lambda.nil?
3031     block.call(@lambda, path)
3032     @lambda._pcore_all_contents(path, &block)
3033   end
3034   path.pop
3035 end
_pcore_contents() { |functor_expr| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
3014 def _pcore_contents
3015   yield(@functor_expr) unless @functor_expr.nil?
3016   @arguments.each { |value| yield(value) }
3017   yield(@lambda) unless @lambda.nil?
3018 end
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned#_pcore_init_hash
     # File lib/puppet/pops/model/ast.rb
3005 def _pcore_init_hash
3006   result = super
3007   result['rval_required'] = @rval_required unless @rval_required == false
3008   result['functor_expr'] = @functor_expr
3009   result['arguments'] = @arguments unless _pcore_type['arguments'].default_value?(@arguments)
3010   result['lambda'] = @lambda unless @lambda == nil
3011   result
3012 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
3037 def eql?(o)
3038   super &&
3039   @rval_required.eql?(o.rval_required) &&
3040   @functor_expr.eql?(o.functor_expr) &&
3041   @arguments.eql?(o.arguments) &&
3042   @lambda.eql?(o.lambda)
3043 end
Also aliased as: ==