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 2631 def self._pcore_type 2632 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LambdaExpression', { 2633 'parent' => Expression._pcore_type, 2634 'attributes' => { 2635 'parameters' => { 2636 'type' => Types::PArrayType.new(Parameter._pcore_type), 2637 'value' => [] 2638 }, 2639 'body' => { 2640 'type' => Types::POptionalType.new(Expression._pcore_type), 2641 'value' => nil 2642 }, 2643 'return_type' => { 2644 'type' => Types::POptionalType.new(Expression._pcore_type), 2645 'value' => nil 2646 } 2647 } 2648 }) 2649 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 2665 def self.create(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil) 2666 ta = Types::TypeAsserter 2667 attrs = _pcore_type.attributes(true) 2668 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 2669 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 2670 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 2671 ta.assert_instance_of('Puppet::AST::LambdaExpression[parameters]', attrs['parameters'].type, parameters) 2672 ta.assert_instance_of('Puppet::AST::LambdaExpression[body]', attrs['body'].type, body) 2673 ta.assert_instance_of('Puppet::AST::LambdaExpression[return_type]', attrs['return_type'].type, return_type) 2674 new(locator, offset, length, parameters, body, return_type) 2675 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2655 def self.from_asserted_hash(init_hash) 2656 new( 2657 init_hash['locator'], 2658 init_hash['offset'], 2659 init_hash['length'], 2660 init_hash.fetch('parameters') { _pcore_type['parameters'].value }, 2661 init_hash['body'], 2662 init_hash['return_type']) 2663 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2651 def self.from_hash(init_hash) 2652 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LambdaExpression initializer', _pcore_type.init_hash_type, init_hash)) 2653 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 2681 def initialize(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil) 2682 super(locator, offset, length) 2683 @hash = @hash ^ parameters.hash ^ body.hash ^ return_type.hash 2684 @parameters = parameters 2685 @body = body 2686 @return_type = return_type 2687 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2703 def _pcore_all_contents(path, &block) 2704 path << self 2705 @parameters.each do |value| 2706 block.call(value, path) 2707 value._pcore_all_contents(path, &block) 2708 end 2709 unless @body.nil? 2710 block.call(@body, path) 2711 @body._pcore_all_contents(path, &block) 2712 end 2713 unless @return_type.nil? 2714 block.call(@return_type, path) 2715 @return_type._pcore_all_contents(path, &block) 2716 end 2717 path.pop 2718 end
_pcore_contents() { |value| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 2697 def _pcore_contents 2698 @parameters.each { |value| yield(value) } 2699 yield(@body) unless @body.nil? 2700 yield(@return_type) unless @return_type.nil? 2701 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 2689 def _pcore_init_hash 2690 result = super 2691 result['parameters'] = @parameters unless _pcore_type['parameters'].default_value?(@parameters) 2692 result['body'] = @body unless @body == nil 2693 result['return_type'] = @return_type unless @return_type == nil 2694 result 2695 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 2720 def eql?(o) 2721 super && 2722 @parameters.eql?(o.parameters) && 2723 @body.eql?(o.body) && 2724 @return_type.eql?(o.return_type) 2725 end
Also aliased as: ==