lib/ext/core.rb in git-style-binaries-0.1.11 vs lib/ext/core.rb in git-style-binaries-0.2.0
- old
+ new
@@ -1,9 +1,10 @@
class Object
- def returning(value)
- yield(value)
- value
- end unless Object.respond_to?(:returning)
+ # ruby 1.8.6 backport of tap
+ def tap
+ yield(self)
+ self
+ end unless Object.respond_to?(:tap)
end
class Symbol
def to_proc
Proc.new { |*args| args.shift.__send__(self, *args) }