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



2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
# File 'lib/multi-tk.rb', line 2075

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