refr 0.0.3 → 0.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/refr.rb +4 -2
- metadata +1 -1
data/lib/refr.rb
CHANGED
@@ -15,8 +15,8 @@ class Reference < BasicObject
|
|
15
15
|
self.new(block.call, block.binding)
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.[] (value)
|
19
|
-
self.local { :value }
|
18
|
+
def self.[] (value, force=false)
|
19
|
+
value.respond_to?(:___is_a_reference___) and not force ? value : self.local { :value }
|
20
20
|
end
|
21
21
|
|
22
22
|
BasicObject.instance_methods.each {|meth|
|
@@ -45,4 +45,6 @@ class Reference < BasicObject
|
|
45
45
|
def method_missing (id, *args, &block)
|
46
46
|
__get__.__send__(id, *args, &block)
|
47
47
|
end
|
48
|
+
|
49
|
+
def ___is_a_reference___; end
|
48
50
|
end
|