Class: Object

Inherits:
BasicObject
Defined in:
lib/multi-tk.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args) ⇒ Object



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/multi-tk.rb', line 68

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