class Puppet::Pops::Model::UnaryExpression

Attributes

expr[R]

Public Class Methods

_pcore_type() click to toggle source
    # File lib/puppet/pops/model/ast.rb
226 def self._pcore_type
227   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::UnaryExpression', {
228     'parent' => Expression._pcore_type,
229     'attributes' => {
230       'expr' => Expression._pcore_type
231     }
232   })
233 end
create(locator, offset, length, expr) click to toggle source
    # File lib/puppet/pops/model/ast.rb
247 def self.create(locator, offset, length, expr)
248   ta = Types::TypeAsserter
249   attrs = _pcore_type.attributes(true)
250   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
251   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
252   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
253   ta.assert_instance_of('Puppet::AST::UnaryExpression[expr]', attrs['expr'].type, expr)
254   new(locator, offset, length, expr)
255 end
from_asserted_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
239 def self.from_asserted_hash(init_hash)
240   new(
241     init_hash['locator'],
242     init_hash['offset'],
243     init_hash['length'],
244     init_hash['expr'])
245 end
from_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
235 def self.from_hash(init_hash)
236   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::UnaryExpression initializer', _pcore_type.init_hash_type, init_hash))
237 end
new(locator, offset, length, expr) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
    # File lib/puppet/pops/model/ast.rb
259 def initialize(locator, offset, length, expr)
260   super(locator, offset, length)
261   @hash = @hash ^ expr.hash
262   @expr = expr
263 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
    # File lib/puppet/pops/model/ast.rb
275 def _pcore_all_contents(path, &block)
276   path << self
277   unless @expr.nil?
278     block.call(@expr, path)
279     @expr._pcore_all_contents(path, &block)
280   end
281   path.pop
282 end
_pcore_contents() { |expr| ... } click to toggle source
    # File lib/puppet/pops/model/ast.rb
271 def _pcore_contents
272   yield(@expr) unless @expr.nil?
273 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
265 def _pcore_init_hash
266   result = super
267   result['expr'] = @expr
268   result
269 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
    # File lib/puppet/pops/model/ast.rb
284 def eql?(o)
285   super &&
286   @expr.eql?(o.expr)
287 end
Also aliased as: ==