class Puppet::Pops::Model::TypeAlias

Attributes

type_expr[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
2112 def self._pcore_type
2113   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::TypeAlias', {
2114     'parent' => QRefDefinition._pcore_type,
2115     'attributes' => {
2116       'type_expr' => {
2117         'type' => Types::POptionalType.new(Expression._pcore_type),
2118         'value' => nil
2119       }
2120     }
2121   })
2122 end
create(locator, offset, length, name, type_expr = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2137 def self.create(locator, offset, length, name, type_expr = nil)
2138   ta = Types::TypeAsserter
2139   attrs = _pcore_type.attributes(true)
2140   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2141   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2142   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2143   ta.assert_instance_of('Puppet::AST::QRefDefinition[name]', attrs['name'].type, name)
2144   ta.assert_instance_of('Puppet::AST::TypeAlias[type_expr]', attrs['type_expr'].type, type_expr)
2145   new(locator, offset, length, name, type_expr)
2146 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2128 def self.from_asserted_hash(init_hash)
2129   new(
2130     init_hash['locator'],
2131     init_hash['offset'],
2132     init_hash['length'],
2133     init_hash['name'],
2134     init_hash['type_expr'])
2135 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2124 def self.from_hash(init_hash)
2125   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::TypeAlias initializer', _pcore_type.init_hash_type, init_hash))
2126 end
new(locator, offset, length, name, type_expr = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2150 def initialize(locator, offset, length, name, type_expr = nil)
2151   super(locator, offset, length, name)
2152   @hash = @hash ^ type_expr.hash
2153   @type_expr = type_expr
2154 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2166 def _pcore_all_contents(path, &block)
2167   path << self
2168   unless @type_expr.nil?
2169     block.call(@type_expr, path)
2170     @type_expr._pcore_all_contents(path, &block)
2171   end
2172   path.pop
2173 end
_pcore_contents() { |type_expr| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
2162 def _pcore_contents
2163   yield(@type_expr) unless @type_expr.nil?
2164 end
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::QRefDefinition#_pcore_init_hash
     # File lib/puppet/pops/model/ast.rb
2156 def _pcore_init_hash
2157   result = super
2158   result['type_expr'] = @type_expr unless @type_expr == nil
2159   result
2160 end
eql?(o) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2175 def eql?(o)
2176   super &&
2177   @type_expr.eql?(o.type_expr)
2178 end
Also aliased as: ==