rubyx-debugger/app/main/controllers/classes_controller.rb

33 lines
741 B
Ruby
Raw Normal View History

2015-07-31 18:35:06 +02:00
module Main
class ClassesController < Volt::ModelController
def initialize *args
super(*args)
page._classes!.clear
2015-08-10 21:29:49 +02:00
all = []
2015-07-31 18:35:06 +02:00
Virtual.machine.space.classes.each do |name , claz|
next if [:Kernel,:Module,:MetaClass,:BinaryCode].index name
2015-08-10 21:29:49 +02:00
all << name
end
all.sort.each do |name|
2015-07-31 18:35:06 +02:00
c = Volt::Model.new :name => name
page._classes << c
end
end
2015-08-10 21:29:49 +02:00
def variables(clas_model)
self.variables(clas_model.name)
end
def self.variables(clas_name)
layout = Virtual.machine.space.get_class_by_name(clas_name).object_layout
vars = []
layout.object_instance_names.each do |name|
vars << name
end
vars
end
2015-07-31 18:35:06 +02:00
end
end