From 9f0d9bd7111ecfbc087cc4dfe6b4d46e8b98800f Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 1 Feb 2002 06:03:03 +0000 Subject: * file.c (rb_stat_inspect): print dev, rdev in hexadecimal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/singleton.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/singleton.rb b/lib/singleton.rb index 2b5a3a3cb5..6ff6d190f2 100644 --- a/lib/singleton.rb +++ b/lib/singleton.rb @@ -66,18 +66,17 @@ module Singleton # singletons types (sounds like an oxymoron) and # helps out people counting on transitive mixins unless mod.instance_of? (Class) - raise TypeError.new "Inclusion of the OO-Singleton module in module #{mod}" + raise TypeError, "Inclusion of the OO-Singleton module in module #{mod}" end unless (class << mod; self end) <= (class << Object; self end) - raise TypeError.new "Inclusion of the OO-Singleton module in singleton type" + raise TypeError, "Inclusion of the OO-Singleton module in singleton type" end super end def included (klass) # remove build in copying methods klass.class_eval do - undef_method(:clone) rescue nil - undef_method(:dup) rescue nil + define_method(:clone) {raise TypeError, "can't clone singleton #{self.type}"} end # initialize the ``klass instance variable'' @__instance__ to nil -- cgit v1.2.3