reduce object to list and register to show that list
also remove duplication in registercontroller ready for events
This commit is contained in:
parent
d7e0cd665f
commit
719f026d0f
@ -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
|
||||
|
@ -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
|
||||
|
@ -2,8 +2,6 @@
|
||||
objects index
|
||||
|
||||
<:Body>
|
||||
<li>
|
||||
<a href="#">{{marker(attrs.id)}} {{attrs.id}}</a>
|
||||
{{ if(is_object?(attrs.id) ) }}
|
||||
<ul>
|
||||
{{content(attrs.id).each do |con3| }}
|
||||
@ -13,4 +11,3 @@
|
||||
{{end}}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</li>
|
||||
|
@ -4,13 +4,16 @@
|
||||
<:Body>
|
||||
<div class="registers-view">
|
||||
{{ model.each do |reg| }}
|
||||
<div class="register-view">
|
||||
<ul id="nav">
|
||||
<a href="#">{{reg.name}} : {{reg.value}}</a>
|
||||
{{ reg.fields.each do |attribute| }}
|
||||
<:objects id={{attribute.object_id}} />
|
||||
{{end}}
|
||||
</ul>
|
||||
<div class="register-view" id="nav">
|
||||
{{ if(is_object?(reg.value) ) }}
|
||||
<:objects id={{reg.value}} />
|
||||
{{else}}
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#">{{reg.value}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user