Module: MultiTkIp_PseudoToplevel_Evaluable

Defined in:
lib/multi-tk.rb,
lib/multi-tk.rb

Overview

dummy

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod) ⇒ Object


2065
2066
2067
2068
# File 'lib/multi-tk.rb', line 2065

def self.extended(mod)
  mod.__send__(:extend_object, mod)
  mod.instance_variable_set('@pseudo_toplevel_evaluable', true)
end

Instance Method Details

#pseudo_toplevel_evaluable=(mode) ⇒ Object


2061
2062
2063
# File 'lib/multi-tk.rb', line 2061

def pseudo_toplevel_evaluable=(mode)
  @pseudo_toplevel_evaluable = (mode)? true: false
end

#pseudo_toplevel_evaluable?Boolean

def pseudo_toplevel_eval(body = Proc.new)

Thread.current[:TOPLEVEL] = self
begin
  body.call
ensure
  Thread.current[:TOPLEVEL] = nil
end

end

Returns:

  • (Boolean)

2057
2058
2059
# File 'lib/multi-tk.rb', line 2057

def pseudo_toplevel_evaluable?
  @pseudo_toplevel_evaluable
end