summaryrefslogtreecommitdiff
path: root/lib/weakref.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/weakref.rb')
-rw-r--r--lib/weakref.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/weakref.rb b/lib/weakref.rb
index 824d4016e1..c7274f9664 100644
--- a/lib/weakref.rb
+++ b/lib/weakref.rb
@@ -17,6 +17,8 @@ require "delegate"
#
class WeakRef < Delegator
+ # The version string
+ VERSION = "0.1.4"
##
# RefError is raised when a referenced object has been recycled by the
@@ -29,9 +31,6 @@ class WeakRef < Delegator
##
# Creates a weak reference to +orig+
- #
- # Raises an ArgumentError if the given +orig+ is immutable, such as Symbol,
- # Integer, or Float.
def initialize(orig)
case orig
@@ -43,7 +42,7 @@ class WeakRef < Delegator
super
end
- def __getobj__ # :nodoc:
+ def __getobj__(&_block) # :nodoc:
@@__map[self] or defined?(@delegate_sd_obj) ? @delegate_sd_obj :
Kernel::raise(RefError, "Invalid Reference - probably recycled", Kernel::caller(2))
end