Class: Chelsy::Constant::Integral

Inherits:
Base show all
Defined in:
lib/chelsy/ast.rb

Direct Known Subclasses

Int, Long, LongLong

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Constructor Details

#initialize(value, unsigned: false, base: 10, **rest) ⇒ Integral

Returns a new instance of Integral.



489
490
491
492
493
494
495
# File 'lib/chelsy/ast.rb', line 489

def initialize(value, unsigned: false, base: 10, **rest)
  @value = value
  @unsigned = !!unsigned
  @base = base

  super(**rest)
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



487
488
489
# File 'lib/chelsy/ast.rb', line 487

def base
  @base
end

#valueObject (readonly)

Returns the value of attribute value.



487
488
489
# File 'lib/chelsy/ast.rb', line 487

def value
  @value
end

Instance Method Details

#unsigned?Boolean

Returns:

  • (Boolean)


497
498
499
# File 'lib/chelsy/ast.rb', line 497

def unsigned?
  @unsigned
end