class Puppet::Pops::Model::LambdaExpression

Attributes

body[R]
parameters[R]
return_type[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
2632 def self._pcore_type
2633   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LambdaExpression', {
2634     'parent' => Expression._pcore_type,
2635     'attributes' => {
2636       'parameters' => {
2637         'type' => Types::PArrayType.new(Parameter._pcore_type),
2638         'value' => []
2639       },
2640       'body' => {
2641         'type' => Types::POptionalType.new(Expression._pcore_type),
2642         'value' => nil
2643       },
2644       'return_type' => {
2645         'type' => Types::POptionalType.new(Expression._pcore_type),
2646         'value' => nil
2647       }
2648     }
2649   })
2650 end
create(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2666 def self.create(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil)
2667   ta = Types::TypeAsserter
2668   attrs = _pcore_type.attributes(true)
2669   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2670   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2671   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2672   ta.assert_instance_of('Puppet::AST::LambdaExpression[parameters]', attrs['parameters'].type, parameters)
2673   ta.assert_instance_of('Puppet::AST::LambdaExpression[body]', attrs['body'].type, body)
2674   ta.assert_instance_of('Puppet::AST::LambdaExpression[return_type]', attrs['return_type'].type, return_type)
2675   new(locator, offset, length, parameters, body, return_type)
2676 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2656 def self.from_asserted_hash(init_hash)
2657   new(
2658     init_hash['locator'],
2659     init_hash['offset'],
2660     init_hash['length'],
2661     init_hash.fetch('parameters') { _pcore_type['parameters'].value },
2662     init_hash['body'],
2663     init_hash['return_type'])
2664 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2652 def self.from_hash(init_hash)
2653   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LambdaExpression initializer', _pcore_type.init_hash_type, init_hash))
2654 end
new(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
2682 def initialize(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil)
2683   super(locator, offset, length)
2684   @hash = @hash ^ parameters.hash ^ body.hash ^ return_type.hash
2685   @parameters = parameters
2686   @body = body
2687   @return_type = return_type
2688 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2704 def _pcore_all_contents(path, &block)
2705   path << self
2706   @parameters.each do |value|
2707     block.call(value, path)
2708     value._pcore_all_contents(path, &block)
2709   end
2710   unless @body.nil?
2711     block.call(@body, path)
2712     @body._pcore_all_contents(path, &block)
2713   end
2714   unless @return_type.nil?
2715     block.call(@return_type, path)
2716     @return_type._pcore_all_contents(path, &block)
2717   end
2718   path.pop
2719 end
_pcore_contents() { |value| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
2698 def _pcore_contents
2699   @parameters.each { |value| yield(value) }
2700   yield(@body) unless @body.nil?
2701   yield(@return_type) unless @return_type.nil?
2702 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
2690 def _pcore_init_hash
2691   result = super
2692   result['parameters'] = @parameters unless _pcore_type['parameters'].default_value?(@parameters)
2693   result['body'] = @body unless @body == nil
2694   result['return_type'] = @return_type unless @return_type == nil
2695   result
2696 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
2721 def eql?(o)
2722   super &&
2723   @parameters.eql?(o.parameters) &&
2724   @body.eql?(o.body) &&
2725   @return_type.eql?(o.return_type)
2726 end
Also aliased as: ==