refr 0.0.3 → 0.0.3.1

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.
Files changed (2) hide show
  1. data/lib/refr.rb +4 -2
  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
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refr
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - meh.