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 1748 def self._pcore_type 1749 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Parameter', { 1750 'parent' => Positioned._pcore_type, 1751 'attributes' => { 1752 'name' => Types::PStringType::DEFAULT, 1753 'value' => { 1754 'type' => Types::POptionalType.new(Expression._pcore_type), 1755 'value' => nil 1756 }, 1757 'type_expr' => { 1758 'type' => Types::POptionalType.new(Expression._pcore_type), 1759 'value' => nil 1760 }, 1761 'captures_rest' => { 1762 'type' => Types::POptionalType.new(Types::PBooleanType::DEFAULT), 1763 'value' => nil 1764 } 1765 } 1766 }) 1767 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 1784 def self.create(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil) 1785 ta = Types::TypeAsserter 1786 attrs = _pcore_type.attributes(true) 1787 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 1788 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 1789 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 1790 ta.assert_instance_of('Puppet::AST::Parameter[name]', attrs['name'].type, name) 1791 ta.assert_instance_of('Puppet::AST::Parameter[value]', attrs['value'].type, value) 1792 ta.assert_instance_of('Puppet::AST::Parameter[type_expr]', attrs['type_expr'].type, type_expr) 1793 ta.assert_instance_of('Puppet::AST::Parameter[captures_rest]', attrs['captures_rest'].type, captures_rest) 1794 new(locator, offset, length, name, value, type_expr, captures_rest) 1795 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1773 def self.from_asserted_hash(init_hash) 1774 new( 1775 init_hash['locator'], 1776 init_hash['offset'], 1777 init_hash['length'], 1778 init_hash['name'], 1779 init_hash['value'], 1780 init_hash['type_expr'], 1781 init_hash['captures_rest']) 1782 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1769 def self.from_hash(init_hash) 1770 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::Parameter initializer', _pcore_type.init_hash_type, init_hash)) 1771 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 1802 def initialize(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil) 1803 super(locator, offset, length) 1804 @hash = @hash ^ name.hash ^ value.hash ^ type_expr.hash ^ captures_rest.hash 1805 @name = name 1806 @value = value 1807 @type_expr = type_expr 1808 @captures_rest = captures_rest 1809 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1825 def _pcore_all_contents(path, &block) 1826 path << self 1827 unless @value.nil? 1828 block.call(@value, path) 1829 @value._pcore_all_contents(path, &block) 1830 end 1831 unless @type_expr.nil? 1832 block.call(@type_expr, path) 1833 @type_expr._pcore_all_contents(path, &block) 1834 end 1835 path.pop 1836 end
_pcore_contents() { |value| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 1820 def _pcore_contents 1821 yield(@value) unless @value.nil? 1822 yield(@type_expr) unless @type_expr.nil? 1823 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 1811 def _pcore_init_hash 1812 result = super 1813 result['name'] = @name 1814 result['value'] = @value unless @value == nil 1815 result['type_expr'] = @type_expr unless @type_expr == nil 1816 result['captures_rest'] = @captures_rest unless @captures_rest == nil 1817 result 1818 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 1838 def eql?(o) 1839 super && 1840 @name.eql?(o.name) && 1841 @value.eql?(o.value) && 1842 @type_expr.eql?(o.type_expr) && 1843 @captures_rest.eql?(o.captures_rest) 1844 end
Also aliased as: ==