2014-07-15 08:31:25 +02:00
|
|
|
|
|
|
|
module Virtual
|
|
|
|
# Integer and (Object) References are the main derived classes, but float will come and ...
|
|
|
|
# The Mystery Type has unknown type and has only casting methods. So it must be cast to be useful.
|
|
|
|
class Type
|
2014-07-15 08:34:45 +02:00
|
|
|
def == other
|
2015-05-24 12:55:05 +02:00
|
|
|
return false unless other.class == self.class
|
2014-07-15 08:34:45 +02:00
|
|
|
return true
|
|
|
|
end
|
2014-07-15 08:31:25 +02:00
|
|
|
end
|
2015-05-24 12:55:05 +02:00
|
|
|
|
2014-07-15 08:31:25 +02:00
|
|
|
class Integer < Type
|
|
|
|
end
|
2015-05-24 12:55:05 +02:00
|
|
|
|
2014-07-15 08:31:25 +02:00
|
|
|
class Reference < Type
|
2015-05-24 12:55:05 +02:00
|
|
|
# possibly unknown value, but known class (as in methods)
|
|
|
|
def initialize clazz = nil
|
|
|
|
@of_class = clazz
|
|
|
|
end
|
|
|
|
attr_reader :of_class
|
2014-07-15 08:31:25 +02:00
|
|
|
end
|
2015-05-24 12:55:05 +02:00
|
|
|
|
2014-07-15 08:31:25 +02:00
|
|
|
class Mystery < Type
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|