Class: Puppet::Pops::Model::QRefDefinition
Instance Attribute Summary collapse
Attributes inherited from Positioned
#length, #locator, #offset
Attributes inherited from PopsObject
#hash
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Positioned
#file, #line, #pos
Methods inherited from PopsObject
#_pcore_all_contents, #_pcore_contents, #to_s
#_pcore_all_contents, #_pcore_contents, #_pcore_type, #to_s
Constructor Details
#initialize(locator, offset, length, name) ⇒ QRefDefinition
Returns a new instance of QRefDefinition.
2093
2094
2095
2096
2097
|
# File 'lib/puppet/pops/model/ast.rb', line 2093
def initialize(locator, offset, length, name)
super(locator, offset, length)
@hash = @hash ^ name.hash
@name = name
end
|
Instance Attribute Details
2091
2092
2093
|
# File 'lib/puppet/pops/model/ast.rb', line 2091
def name
@name
end
|
Class Method Details
.create(locator, offset, length, name) ⇒ Object
2081
2082
2083
2084
2085
2086
2087
2088
2089
|
# File 'lib/puppet/pops/model/ast.rb', line 2081
def self.create(locator, offset, length, name)
ta = Types::TypeAsserter
attrs = _pcore_type.attributes(true)
ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
ta.assert_instance_of('Puppet::AST::QRefDefinition[name]', attrs['name'].type, name)
new(locator, offset, length, name)
end
|
.from_asserted_hash(init_hash) ⇒ Object
2073
2074
2075
2076
2077
2078
2079
|
# File 'lib/puppet/pops/model/ast.rb', line 2073
def self.from_asserted_hash(init_hash)
new(
init_hash['locator'],
init_hash['offset'],
init_hash['length'],
init_hash['name'])
end
|
.from_hash(init_hash) ⇒ Object
2069
2070
2071
|
# File 'lib/puppet/pops/model/ast.rb', line 2069
def self.from_hash(init_hash)
from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::QRefDefinition initializer', _pcore_type.init_hash_type, init_hash))
end
|
Instance Method Details
#_pcore_init_hash ⇒ Object
2099
2100
2101
2102
2103
|
# File 'lib/puppet/pops/model/ast.rb', line 2099
def _pcore_init_hash
result = super
result['name'] = @name
result
end
|
#eql?(o) ⇒ Boolean
Also known as:
==
2105
2106
2107
2108
|
# File 'lib/puppet/pops/model/ast.rb', line 2105
def eql?(o)
super &&
@name.eql?(o.name)
end
|