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
3277 def self._pcore_type
3278   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralInteger', {
3279     'parent' => LiteralNumber._pcore_type,
3280     'attributes' => {
3281       'radix' => {
3282         'type' => Types::PIntegerType::DEFAULT,
3283         'value' => 10
3284       },
3285       'value' => Types::PIntegerType::DEFAULT
3286     }
3287   })
3288 end
create(locator, offset, length, value, radix = 10) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3303 def self.create(locator, offset, length, value, radix = 10)
3304   ta = Types::TypeAsserter
3305   attrs = _pcore_type.attributes(true)
3306   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3307   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3308   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3309   ta.assert_instance_of('Puppet::AST::LiteralInteger[radix]', attrs['radix'].type, radix)
3310   ta.assert_instance_of('Puppet::AST::LiteralInteger[value]', attrs['value'].type, value)
3311   new(locator, offset, length, value, radix)
3312 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3294 def self.from_asserted_hash(init_hash)
3295   new(
3296     init_hash['locator'],
3297     init_hash['offset'],
3298     init_hash['length'],
3299     init_hash['value'],
3300     init_hash.fetch('radix') { 10 })
3301 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3290 def self.from_hash(init_hash)
3291   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralInteger initializer', _pcore_type.init_hash_type, init_hash))
3292 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
3317 def initialize(locator, offset, length, value, radix = 10)
3318   super(locator, offset, length)
3319   @hash = @hash ^ radix.hash ^ value.hash
3320   @radix = radix
3321   @value = value
3322 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
3324 def _pcore_init_hash
3325   result = super
3326   result['radix'] = @radix unless @radix == 10
3327   result['value'] = @value
3328   result
3329 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
3331 def eql?(o)
3332   super &&
3333   @radix.eql?(o.radix) &&
3334   @value.eql?(o.value)
3335 end
Also aliased as: ==