Module: MultiTkIp_PseudoToplevel_Evaluable

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

Overview

dummy

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod) ⇒ Object



64
65
66
67
# File 'ext/lib/multi-tk.rb', line 64

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



60
61
62
# File 'ext/lib/multi-tk.rb', line 60

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)


56
57
58
# File 'ext/lib/multi-tk.rb', line 56

def pseudo_toplevel_evaluable?
  @pseudo_toplevel_evaluable
end