moving know_object out of the base class
object is only common to constant and object slots (which should be unified) On the way to making the array recursive
This commit is contained in:
@ -29,17 +29,16 @@ module SlotMachine
|
||||
end
|
||||
end
|
||||
|
||||
attr_reader :known_object , :slots
|
||||
attr_reader :slots
|
||||
# is an array of symbols, that specifies the first the object, and then the Slot.
|
||||
# The first element is either a known type name (Capitalized symbol of the class name) ,
|
||||
# or the symbol :message
|
||||
# And subsequent symbols must be instance variables on the previous type.
|
||||
# Examples: [:message , :receiver] or [:Space , :next_message]
|
||||
def initialize( object , slots)
|
||||
def initialize( slots)
|
||||
raise "No slots #{object}" unless slots
|
||||
slots = [slots] unless slots.is_a?(Array)
|
||||
@known_object , @slots = object , slots
|
||||
raise "Not known #{slots}" unless object
|
||||
@slots = slots
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
Reference in New Issue
Block a user