Class: Puppet::Pops::Model::LiteralFloat
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, value) ⇒ LiteralFloat
Returns a new instance of LiteralFloat.
3564
3565
3566
3567
3568
|
# File 'lib/puppet/pops/model/ast.rb', line 3564
def initialize(locator, offset, length, value)
super(locator, offset, length)
@hash = @hash ^ value.hash
@value = value
end
|
Instance Attribute Details
3562
3563
3564
|
# File 'lib/puppet/pops/model/ast.rb', line 3562
def value
@value
end
|
Class Method Details
.create(locator, offset, length, value) ⇒ Object
3552
3553
3554
3555
3556
3557
3558
3559
3560
|
# File 'lib/puppet/pops/model/ast.rb', line 3552
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::LiteralFloat[value]', attrs['value'].type, value)
new(locator, offset, length, value)
end
|
.from_asserted_hash(init_hash) ⇒ Object
3544
3545
3546
3547
3548
3549
3550
|
# File 'lib/puppet/pops/model/ast.rb', line 3544
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
3540
3541
3542
|
# File 'lib/puppet/pops/model/ast.rb', line 3540
def self.from_hash(init_hash)
from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralFloat initializer', _pcore_type.init_hash_type, init_hash))
end
|
Instance Method Details
#_pcore_init_hash ⇒ Object
3570
3571
3572
3573
3574
|
# File 'lib/puppet/pops/model/ast.rb', line 3570
def _pcore_init_hash
result = super
result['value'] = @value
result
end
|
#eql?(o) ⇒ Boolean
Also known as:
==
3576
3577
3578
3579
|
# File 'lib/puppet/pops/model/ast.rb', line 3576
def eql?(o)
super &&
@value.eql?(o.value)
end
|