2015-05-26 19:17:43 +02:00
|
|
|
# A method object is a description of the method, it's name etc
|
|
|
|
#
|
|
|
|
# But the code that the method represents, the binary, is held as an array
|
|
|
|
# in one of these.
|
|
|
|
#
|
|
|
|
# The BinaryCode is really just a name to make sure that when we call a method
|
|
|
|
# it is really the code we call.
|
|
|
|
|
|
|
|
module Parfait
|
|
|
|
# obviously not a "Word" but a ByteArray , but no such class yet
|
|
|
|
# As on the other hand has no encoding (yet) it is close enough
|
2015-10-26 11:24:47 +01:00
|
|
|
class BinaryCode < Object
|
|
|
|
attribute :name
|
|
|
|
|
|
|
|
include Indexed
|
|
|
|
self.offset(2)
|
|
|
|
|
2015-05-28 20:10:27 +02:00
|
|
|
def initialize name
|
2015-10-26 11:24:47 +01:00
|
|
|
super()
|
2015-07-21 14:40:25 +02:00
|
|
|
self.name = name
|
2015-05-28 20:10:27 +02:00
|
|
|
end
|
2015-06-03 09:01:59 +02:00
|
|
|
|
2015-05-28 20:10:27 +02:00
|
|
|
def to_s
|
2015-07-21 14:40:25 +02:00
|
|
|
"BinaryCode #{self.name}"
|
2015-05-28 20:10:27 +02:00
|
|
|
end
|
2015-06-03 09:01:59 +02:00
|
|
|
|
|
|
|
def == other
|
|
|
|
self.object_id == other.object_id
|
|
|
|
end
|
2015-05-26 19:17:43 +02:00
|
|
|
end
|
|
|
|
end
|