class Puppet::Pops::Model::Parameter

Attributes

captures_rest[R]
name[R]
type_expr[R]
value[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
1749 def self._pcore_type
1750   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Parameter', {
1751     'parent' => Positioned._pcore_type,
1752     'attributes' => {
1753       'name' => Types::PStringType::DEFAULT,
1754       'value' => {
1755         'type' => Types::POptionalType.new(Expression._pcore_type),
1756         'value' => nil
1757       },
1758       'type_expr' => {
1759         'type' => Types::POptionalType.new(Expression._pcore_type),
1760         'value' => nil
1761       },
1762       'captures_rest' => {
1763         'type' => Types::POptionalType.new(Types::PBooleanType::DEFAULT),
1764         'value' => nil
1765       }
1766     }
1767   })
1768 end
create(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1785 def self.create(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil)
1786   ta = Types::TypeAsserter
1787   attrs = _pcore_type.attributes(true)
1788   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1789   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1790   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1791   ta.assert_instance_of('Puppet::AST::Parameter[name]', attrs['name'].type, name)
1792   ta.assert_instance_of('Puppet::AST::Parameter[value]', attrs['value'].type, value)
1793   ta.assert_instance_of('Puppet::AST::Parameter[type_expr]', attrs['type_expr'].type, type_expr)
1794   ta.assert_instance_of('Puppet::AST::Parameter[captures_rest]', attrs['captures_rest'].type, captures_rest)
1795   new(locator, offset, length, name, value, type_expr, captures_rest)
1796 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1774 def self.from_asserted_hash(init_hash)
1775   new(
1776     init_hash['locator'],
1777     init_hash['offset'],
1778     init_hash['length'],
1779     init_hash['name'],
1780     init_hash['value'],
1781     init_hash['type_expr'],
1782     init_hash['captures_rest'])
1783 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1770 def self.from_hash(init_hash)
1771   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::Parameter initializer', _pcore_type.init_hash_type, init_hash))
1772 end
new(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
1803 def initialize(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil)
1804   super(locator, offset, length)
1805   @hash = @hash ^ name.hash ^ value.hash ^ type_expr.hash ^ captures_rest.hash
1806   @name = name
1807   @value = value
1808   @type_expr = type_expr
1809   @captures_rest = captures_rest
1810 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1826 def _pcore_all_contents(path, &block)
1827   path << self
1828   unless @value.nil?
1829     block.call(@value, path)
1830     @value._pcore_all_contents(path, &block)
1831   end
1832   unless @type_expr.nil?
1833     block.call(@type_expr, path)
1834     @type_expr._pcore_all_contents(path, &block)
1835   end
1836   path.pop
1837 end
_pcore_contents() { |value| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
1821 def _pcore_contents
1822   yield(@value) unless @value.nil?
1823   yield(@type_expr) unless @type_expr.nil?
1824 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
1812 def _pcore_init_hash
1813   result = super
1814   result['name'] = @name
1815   result['value'] = @value unless @value == nil
1816   result['type_expr'] = @type_expr unless @type_expr == nil
1817   result['captures_rest'] = @captures_rest unless @captures_rest == nil
1818   result
1819 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
1839 def eql?(o)
1840   super &&
1841   @name.eql?(o.name) &&
1842   @value.eql?(o.value) &&
1843   @type_expr.eql?(o.type_expr) &&
1844   @captures_rest.eql?(o.captures_rest)
1845 end
Also aliased as: ==