lib/musterb/binding_extractor.rb in musterb-0.1.2 vs lib/musterb/binding_extractor.rb in musterb-0.2.0
- old
+ new
@@ -1,11 +1,14 @@
class Musterb::BindingExtractor
- def initialize(_binding)
+ attr_reader :value, :parent
+
+ def initialize(_binding, parent)
@binding = _binding
+ @parent = parent
end
def [](symbol)
@binding.eval symbol
rescue NameError
- nil
+ parent[symbol]
end
end