class Puppet::Pops::Model::LiteralInteger

Attributes

radix[R]
value[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
3278 def self._pcore_type
3279   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralInteger', {
3280     'parent' => LiteralNumber._pcore_type,
3281     'attributes' => {
3282       'radix' => {
3283         'type' => Types::PIntegerType::DEFAULT,
3284         'value' => 10
3285       },
3286       'value' => Types::PIntegerType::DEFAULT
3287     }
3288   })
3289 end
create(locator, offset, length, value, radix = 10) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3304 def self.create(locator, offset, length, value, radix = 10)
3305   ta = Types::TypeAsserter
3306   attrs = _pcore_type.attributes(true)
3307   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3308   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3309   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3310   ta.assert_instance_of('Puppet::AST::LiteralInteger[radix]', attrs['radix'].type, radix)
3311   ta.assert_instance_of('Puppet::AST::LiteralInteger[value]', attrs['value'].type, value)
3312   new(locator, offset, length, value, radix)
3313 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3295 def self.from_asserted_hash(init_hash)
3296   new(
3297     init_hash['locator'],
3298     init_hash['offset'],
3299     init_hash['length'],
3300     init_hash['value'],
3301     init_hash.fetch('radix') { 10 })
3302 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3291 def self.from_hash(init_hash)
3292   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralInteger initializer', _pcore_type.init_hash_type, init_hash))
3293 end
new(locator, offset, length, value, radix = 10) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
3318 def initialize(locator, offset, length, value, radix = 10)
3319   super(locator, offset, length)
3320   @hash = @hash ^ radix.hash ^ value.hash
3321   @radix = radix
3322   @value = value
3323 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned#_pcore_init_hash
     # File lib/puppet/pops/model/ast.rb
3325 def _pcore_init_hash
3326   result = super
3327   result['radix'] = @radix unless @radix == 10
3328   result['value'] = @value
3329   result
3330 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
3332 def eql?(o)
3333   super &&
3334   @radix.eql?(o.radix) &&
3335   @value.eql?(o.value)
3336 end
Also aliased as: ==