From: "charliesome (Charlie Somerville)" Date: 2013-09-11T20:23:37+09:00 Subject: [ruby-core:57135] [CommonRuby - Feature #8896] #tap with missing block Issue #8896 has been updated by charliesome (Charlie Somerville). I would like to see tap return an Enumerator if a block is not passed. ---------------------------------------- Feature #8896: #tap with missing block https://bugs.ruby-lang.org/issues/8896#change-41739 Author: prijutme4ty (Ilya Vorontsov) Status: Open Priority: Normal Assignee: Category: Target version: In case when no block provided to tap, it fails. So if you want method which can be called with or without block - you can't do it like this: def self.create(args={}, &block) new.set_attributes(args).tap(&block) end but should use block_defined? to prevent #tap's failure. I suggest to make tap with no block given just to return self and raise no errors. -- http://bugs.ruby-lang.org/