rubyx-debugger/app/register_view.rb

44 lines
983 B
Ruby
Raw Normal View History

2015-07-22 15:22:54 +02:00
class RegisterView
include React::Component
2015-07-23 19:08:40 +02:00
required_param :interpreter
define_state :registers
before_mount do
interpreter.register_event(:register_changed, self)
registers! interpreter.registers
end
def register_changed reg , old , bl
registers! interpreter.registers
end
2015-07-22 15:22:54 +02:00
def render
2015-07-25 20:04:20 +02:00
div.row do
registers.each do |r , has|
2015-07-25 20:04:20 +02:00
div.col_md_1 do
div.row do
div.col_md_12 do
"#{r} : #{has}"
end
if object = has_object(has)
div.col_md_12 do
object.class.name.split("::").last.span
end
object.get_instance_variables.each do |variable|
div.col_md_12 do
object.get_instance_variable(variable).to_s.span
end
end
end #if
end
end #row
2015-07-22 15:22:54 +02:00
end
end
end
2015-07-25 20:04:20 +02:00
def has_object has
object = Virtual.machine.objects[has]
end
2015-07-22 15:22:54 +02:00
end