reduce object to list and register to show that list

also remove duplication in registercontroller
ready for events
This commit is contained in:
Torsten Ruger
2015-08-19 00:22:08 +02:00
parent d7e0cd665f
commit 719f026d0f
4 changed files with 18 additions and 33 deletions

View File

@ -16,8 +16,12 @@ module Main
def marker id
var = Virtual.machine.objects[id]
return "Wo" if var.is_a? String
var.class.name.split("::").last[0,2]
if var.is_a? String
str "Wo"
else
str = var.class.name.split("::").last[0,2]
end
str + " : #{id.to_s}"
end
def content(id)
@ -29,7 +33,7 @@ module Main
fields << ["--------------------" , 0 ]
object.get_instance_variables.each do |variable|
f = object.get_instance_variable(variable)
fields << ["#{variable} : #{marker(f.object_id)} : #{f.object_id}" , f.object_id]
fields << ["#{variable} : #{marker(f.object_id)}" , f.object_id]
end
end
fields

View File

@ -18,28 +18,9 @@ module Main
end
end
def marker var
return "Wo" if var.is_a? String
var.class.name.split("::").last[0,2]
end
def content(id)
object = Virtual.machine.objects[id]
fields = []
if object and ! object.is_a?(String)
clazz = object.class.name.split("::").last
fields << ["#{clazz}:#{object.internal_object_length}" , 0]
fields << ["--------------------" , 0 ]
object.get_instance_variables.each do |variable|
f = object.get_instance_variable(variable)
fields << ["#{variable} : #{marker(f)} : #{f.object_id}" , f.object_id]
end
end
fields
end
def is_object?( id )
Virtual.machine.objects[id] != nil
end
end
end