class Puppet::Pops::Model::ApplyExpression

Attributes

arguments[R]
body[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
2731 def self._pcore_type
2732   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ApplyExpression', {
2733     'parent' => Expression._pcore_type,
2734     'attributes' => {
2735       'arguments' => {
2736         'type' => Types::PArrayType.new(Expression._pcore_type),
2737         'value' => []
2738       },
2739       'body' => {
2740         'type' => Types::POptionalType.new(Expression._pcore_type),
2741         'value' => nil
2742       }
2743     }
2744   })
2745 end
create(locator, offset, length, arguments = _pcore_type['arguments'].value, body = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2760 def self.create(locator, offset, length, arguments = _pcore_type['arguments'].value, body = nil)
2761   ta = Types::TypeAsserter
2762   attrs = _pcore_type.attributes(true)
2763   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2764   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2765   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2766   ta.assert_instance_of('Puppet::AST::ApplyExpression[arguments]', attrs['arguments'].type, arguments)
2767   ta.assert_instance_of('Puppet::AST::ApplyExpression[body]', attrs['body'].type, body)
2768   new(locator, offset, length, arguments, body)
2769 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2751 def self.from_asserted_hash(init_hash)
2752   new(
2753     init_hash['locator'],
2754     init_hash['offset'],
2755     init_hash['length'],
2756     init_hash.fetch('arguments') { _pcore_type['arguments'].value },
2757     init_hash['body'])
2758 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2747 def self.from_hash(init_hash)
2748   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ApplyExpression initializer', _pcore_type.init_hash_type, init_hash))
2749 end
new(locator, offset, length, arguments = _pcore_type['arguments'].value, body = nil) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
2774 def initialize(locator, offset, length, arguments = _pcore_type['arguments'].value, body = nil)
2775   super(locator, offset, length)
2776   @hash = @hash ^ arguments.hash ^ body.hash
2777   @arguments = arguments
2778   @body = body
2779 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2793 def _pcore_all_contents(path, &block)
2794   path << self
2795   @arguments.each do |value|
2796     block.call(value, path)
2797     value._pcore_all_contents(path, &block)
2798   end
2799   unless @body.nil?
2800     block.call(@body, path)
2801     @body._pcore_all_contents(path, &block)
2802   end
2803   path.pop
2804 end
_pcore_contents() { |value| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
2788 def _pcore_contents
2789   @arguments.each { |value| yield(value) }
2790   yield(@body) unless @body.nil?
2791 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
2781 def _pcore_init_hash
2782   result = super
2783   result['arguments'] = @arguments unless _pcore_type['arguments'].default_value?(@arguments)
2784   result['body'] = @body unless @body == nil
2785   result
2786 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
2806 def eql?(o)
2807   super &&
2808   @arguments.eql?(o.arguments) &&
2809   @body.eql?(o.body)
2810 end
Also aliased as: ==