Class: Object

Inherits:
BasicObject
Includes:
Tk::TOPLEVEL_ALIASES
Defined in:
lib/multi-tk.rb,
lib/tk/autoload.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args) ⇒ Object



2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'lib/multi-tk.rb', line 2068

def method_missing(id, *args)
  begin
    has_top = (top = MultiTkIp.__getip.__pseudo_toplevel) &&
      top.respond_to?(:pseudo_toplevel_evaluable?) &&
      top.pseudo_toplevel_evaluable? &&
      top.respond_to?(id)
  rescue Exception => e
    has_top = false
  end

  if has_top
    top.__send__(id, *args)
  else
    __method_missing_alias_for_MultiTkIp__(id, *args)
  end
end