Class: RLTK::CG::NumberType Abstract

Inherits:
Type
  • Object
show all
Includes:
Filigree::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

BasicIntType, RealType

Instance Attribute Summary

Attributes included from BindingClass

#ptr

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#allignment, #context, #dump, from_ptr, #hash, #initialize, #kind, #size, #to_s

Methods included from BindingClass

#==

Constructor Details

This class inherits a constructor from RLTK::CG::Type

Class Method Details

.value_classValue

Returns The corresponding Value sub-class that is used to represent values of this type.

Returns:

  • (Value)

    The corresponding Value sub-class that is used to represent values of this type.



124
125
126
127
128
129
130
131
132
# File 'lib/rltk/cg/type.rb', line 124

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_classValue

Returns The corresponding Value sub-class that is used to represent values of this type.

Returns:

  • (Value)

    The corresponding Value sub-class that is used to represent values of this type.



135
136
137
# File 'lib/rltk/cg/type.rb', line 135

def value_class
	self.class.value_class
end