Class: Puppet::Pops::Model::LiteralBoolean
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
Constructor Details
#initialize(locator, offset, length, value) ⇒ LiteralBoolean
Returns a new instance of LiteralBoolean.
3510
3511
3512
3513
3514
|
# File 'lib/puppet/pops/model/ast.rb', line 3510
def initialize(locator, offset, length, value)
super(locator, offset, length)
@hash = @hash ^ value.hash
@value = value
end
|
Instance Attribute Details
3508
3509
3510
|
# File 'lib/puppet/pops/model/ast.rb', line 3508
def value
@value
end
|
Class Method Details
.create(locator, offset, length, value) ⇒ Object
3498
3499
3500
3501
3502
3503
3504
3505
3506
|
# File 'lib/puppet/pops/model/ast.rb', line 3498
def self.create(locator, offset, length, value)
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::LiteralBoolean[value]', attrs['value'].type, value)
new(locator, offset, length, value)
end
|
.from_asserted_hash(init_hash) ⇒ Object
3490
3491
3492
3493
3494
3495
3496
|
# File 'lib/puppet/pops/model/ast.rb', line 3490
def self.from_asserted_hash(init_hash)
new(
init_hash['locator'],
init_hash['offset'],
init_hash['length'],
init_hash['value'])
end
|
.from_hash(init_hash) ⇒ Object
3486
3487
3488
|
# File 'lib/puppet/pops/model/ast.rb', line 3486
def self.from_hash(init_hash)
from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralBoolean initializer', _pcore_type.init_hash_type, init_hash))
end
|
Instance Method Details
#_pcore_init_hash ⇒ Object
3516
3517
3518
3519
3520
|
# File 'lib/puppet/pops/model/ast.rb', line 3516
def _pcore_init_hash
result = super
result['value'] = @value
result
end
|
#eql?(o) ⇒ Boolean
Also known as:
==
3522
3523
3524
3525
|
# File 'lib/puppet/pops/model/ast.rb', line 3522
def eql?(o)
super &&
@value.eql?(o.value)
end
|