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 2941 def self._pcore_type 2942 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CallExpression', { 2943 'parent' => Expression._pcore_type, 2944 'attributes' => { 2945 'rval_required' => { 2946 'type' => Types::PBooleanType::DEFAULT, 2947 'value' => false 2948 }, 2949 'functor_expr' => Expression._pcore_type, 2950 'arguments' => { 2951 'type' => Types::PArrayType.new(Expression._pcore_type), 2952 'value' => [] 2953 }, 2954 'lambda' => { 2955 'type' => Types::POptionalType.new(Expression._pcore_type), 2956 'value' => nil 2957 } 2958 } 2959 }) 2960 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 2977 def self.create(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil) 2978 ta = Types::TypeAsserter 2979 attrs = _pcore_type.attributes(true) 2980 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 2981 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 2982 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 2983 ta.assert_instance_of('Puppet::AST::CallExpression[rval_required]', attrs['rval_required'].type, rval_required) 2984 ta.assert_instance_of('Puppet::AST::CallExpression[functor_expr]', attrs['functor_expr'].type, functor_expr) 2985 ta.assert_instance_of('Puppet::AST::CallExpression[arguments]', attrs['arguments'].type, arguments) 2986 ta.assert_instance_of('Puppet::AST::CallExpression[lambda]', attrs['lambda'].type, lambda) 2987 new(locator, offset, length, functor_expr, rval_required, arguments, lambda) 2988 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2966 def self.from_asserted_hash(init_hash) 2967 new( 2968 init_hash['locator'], 2969 init_hash['offset'], 2970 init_hash['length'], 2971 init_hash['functor_expr'], 2972 init_hash.fetch('rval_required') { false }, 2973 init_hash.fetch('arguments') { _pcore_type['arguments'].value }, 2974 init_hash['lambda']) 2975 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2962 def self.from_hash(init_hash) 2963 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CallExpression initializer', _pcore_type.init_hash_type, init_hash)) 2964 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 2995 def initialize(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil) 2996 super(locator, offset, length) 2997 @hash = @hash ^ rval_required.hash ^ functor_expr.hash ^ arguments.hash ^ lambda.hash 2998 @rval_required = rval_required 2999 @functor_expr = functor_expr 3000 @arguments = arguments 3001 @lambda = lambda 3002 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 3019 def _pcore_all_contents(path, &block) 3020 path << self 3021 unless @functor_expr.nil? 3022 block.call(@functor_expr, path) 3023 @functor_expr._pcore_all_contents(path, &block) 3024 end 3025 @arguments.each do |value| 3026 block.call(value, path) 3027 value._pcore_all_contents(path, &block) 3028 end 3029 unless @lambda.nil? 3030 block.call(@lambda, path) 3031 @lambda._pcore_all_contents(path, &block) 3032 end 3033 path.pop 3034 end
_pcore_contents() { |functor_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 3013 def _pcore_contents 3014 yield(@functor_expr) unless @functor_expr.nil? 3015 @arguments.each { |value| yield(value) } 3016 yield(@lambda) unless @lambda.nil? 3017 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 3004 def _pcore_init_hash 3005 result = super 3006 result['rval_required'] = @rval_required unless @rval_required == false 3007 result['functor_expr'] = @functor_expr 3008 result['arguments'] = @arguments unless _pcore_type['arguments'].default_value?(@arguments) 3009 result['lambda'] = @lambda unless @lambda == nil 3010 result 3011 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 3036 def eql?(o) 3037 super && 3038 @rval_required.eql?(o.rval_required) && 3039 @functor_expr.eql?(o.functor_expr) && 3040 @arguments.eql?(o.arguments) && 3041 @lambda.eql?(o.lambda) 3042 end
Also aliased as: ==