# File lib/sup/util.rb, line 549 def deinstantiate!; @instance = nil; end
# File lib/sup/util.rb, line 561 def init *args raise "there can be only one! (instance)" if defined? @instance @instance = new(*args) end
# File lib/sup/util.rb, line 548 def instantiated?; defined?(@instance) && !@instance.nil?; end
# File lib/sup/util.rb, line 550 def method_missing meth, *a, &b raise "no #{name} instance defined in method call to #{meth}!" unless defined? @instance ## if we've been deinstantiated, just drop all calls. this is ## useful because threads that might be active during the ## cleanup process (e.g. polling) would otherwise have to ## special-case every call to a Singleton object return nil if @instance.nil? @instance.send meth, *a, &b end
Generated with the Darkfish Rdoc Generator 2.