Class: RLTK::CG::NumberType Abstract
- Includes:
- AbstractClass
- Defined in:
- lib/rltk/cg/type.rb
Overview
This class is abstract.
All types that are used to represent numbers inherit from this class.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from BindingClass
Class Method Summary collapse
-
.value_class ⇒ Value
The corresponding Value sub-class that is used to represent values of this type.
Instance Method Summary collapse
-
#value_class ⇒ Value
The corresponding Value sub-class that is used to represent values of this type.
Methods included from AbstractClass
Methods inherited from Type
#allignment, #context, from_ptr, #hash, #initialize, #kind, #size
Methods included from BindingClass
Constructor Details
This class inherits a constructor from RLTK::CG::Type
Class Method Details
.value_class ⇒ Value
Returns The corresponding Value sub-class that is used to represent values of this type.
109 110 111 112 113 114 115 116 117 |
# File 'lib/rltk/cg/type.rb', line 109 def self.value_class begin @value_class ||= RLTK::CG.const_get(self.name.match(/::(.+)Type$/).captures.last.to_sym) rescue raise "#{self.name} has no value class." end end |
Instance Method Details
#value_class ⇒ Value
Returns The corresponding Value sub-class that is used to represent values of this type.
120 121 122 |
# File 'lib/rltk/cg/type.rb', line 120 def value_class self.class.value_class end |