class Puppet::Pops::Model::UnaryExpression
Attributes
expr[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 225 def self._pcore_type 226 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::UnaryExpression', { 227 'parent' => Expression._pcore_type, 228 'attributes' => { 229 'expr' => Expression._pcore_type 230 } 231 }) 232 end
create(locator, offset, length, expr)
click to toggle source
# File lib/puppet/pops/model/ast.rb 246 def self.create(locator, offset, length, expr) 247 ta = Types::TypeAsserter 248 attrs = _pcore_type.attributes(true) 249 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 250 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 251 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 252 ta.assert_instance_of('Puppet::AST::UnaryExpression[expr]', attrs['expr'].type, expr) 253 new(locator, offset, length, expr) 254 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 238 def self.from_asserted_hash(init_hash) 239 new( 240 init_hash['locator'], 241 init_hash['offset'], 242 init_hash['length'], 243 init_hash['expr']) 244 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 234 def self.from_hash(init_hash) 235 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::UnaryExpression initializer', _pcore_type.init_hash_type, init_hash)) 236 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 258 def initialize(locator, offset, length, expr) 259 super(locator, offset, length) 260 @hash = @hash ^ expr.hash 261 @expr = expr 262 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 274 def _pcore_all_contents(path, &block) 275 path << self 276 unless @expr.nil? 277 block.call(@expr, path) 278 @expr._pcore_all_contents(path, &block) 279 end 280 path.pop 281 end
_pcore_contents() { |expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 270 def _pcore_contents 271 yield(@expr) unless @expr.nil? 272 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 264 def _pcore_init_hash 265 result = super 266 result['expr'] = @expr 267 result 268 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 283 def eql?(o) 284 super && 285 @expr.eql?(o.expr) 286 end
Also aliased as: ==