class TkInspect::Inspector::Base
Attributes
expression[RW]
inspected_binding[RW]
main_component[RW]
tk_root[RW]
Public Class Methods
inspector_for_class(klass)
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 22 def self.inspector_for_class(klass) while klass && !(inspector = custom_inspectors[klass]) do klass = klass.superclass end inspector || self end
inspector_for_object(obj)
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 29 def self.inspector_for_object(obj) self.inspector_for_class(obj.class) end
new(options = {})
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 33 def initialize(options = {}) @expression = options[:expression] @inspected_binding = options[:binding] || binding @value = options[:value] @tk_root = nil @main_component = nil end
Public Instance Methods
browse_class(class_name)
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 52 def browse_class(class_name) class_browser = TkInspect::ClassBrowser::Base.new class_browser.select_class_name(class_name) class_browser.refresh class_browser.show_current_path end
create_main_component()
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 59 def create_main_component @main_component = RootComponent.new end
create_root()
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 45 def create_root @tk_root = TkComponent::Window.new(title: window_title) create_main_component @main_component.inspector = self @tk_root.place_root_component(@main_component) end
refresh()
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 41 def refresh @main_component.nil? ? create_root : @main_component.regenerate end
window_title()
click to toggle source
# File lib/tk_inspect/inspector/base.rb, line 63 def window_title "Inspector" end