refr 0.0.3.1 → 0.0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/refr.rb +6 -2
- metadata +1 -1
data/lib/refr.rb
CHANGED
@@ -16,7 +16,11 @@ class Reference < BasicObject
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.[] (value, force=false)
|
19
|
-
value.respond_to?(:___is_a_reference___)
|
19
|
+
if value.respond_to?(:___is_a_reference___) && !force
|
20
|
+
value
|
21
|
+
else
|
22
|
+
self.local { :value }
|
23
|
+
end
|
20
24
|
end
|
21
25
|
|
22
26
|
BasicObject.instance_methods.each {|meth|
|
@@ -43,7 +47,7 @@ class Reference < BasicObject
|
|
43
47
|
end; alias =~ __set_referenced__
|
44
48
|
|
45
49
|
def method_missing (id, *args, &block)
|
46
|
-
|
50
|
+
__get_referenced__.__send__(id, *args, &block)
|
47
51
|
end
|
48
52
|
|
49
53
|
def ___is_a_reference___; end
|