https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112013-09-11T20:23:37ZRuby Issue Tracking SystemRuby master - Feature #8896: #tap with missing blockhttps://redmine.ruby-lang.org/issues/8896?journal_id=417392013-09-11T20:23:37ZAnonymous
<ul></ul><p>I would like to see tap return an Enumerator if a block is not passed.</p> Ruby master - Feature #8896: #tap with missing blockhttps://redmine.ruby-lang.org/issues/8896?journal_id=417562013-09-12T01:54:17Zprijutme4ty (Ilya Vorontsov)prijutme4ty@gmail.com
<ul></ul><blockquote>
<p>I would like to see tap return an Enumerator if a block is not passed.<br>
Can you explain your suggestion a bit more? I can't imagine realization and use-case yet.</p>
</blockquote> Ruby master - Feature #8896: #tap with missing blockhttps://redmine.ruby-lang.org/issues/8896?journal_id=417572013-09-12T01:59:13Zfuadksd (Fuad Saud)fuadksd@gmail.com
<ul></ul><p>#tap without a block returning self makes sense</p>
<p>--<br>
Fuad Saud<br>
Sent with Sparrow (<a href="http://www.sparrowmailapp.com/?sig" class="external">http://www.sparrowmailapp.com/?sig</a>)</p>
<p>On Wednesday, September 11, 2013 at 1:54 PM, prijutme4ty (Ilya Vorontsov) wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: #tap with missing block (Open)" href="https://redmine.ruby-lang.org/issues/8896">#8896</a> has been updated by prijutme4ty (Ilya Vorontsov).</p>
<blockquote>
<p>I would like to see tap return an Enumerator if a block is not passed.<br>
Can you explain your suggestion a bit more? I can't imagine realization and use-case yet.</p>
</blockquote>
<hr>
<p>Feature <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: #tap with missing block (Open)" href="https://redmine.ruby-lang.org/issues/8896">#8896</a>: #tap with missing block<br>
<a href="https://bugs.ruby-lang.org/issues/8896#change-41756" class="external">https://bugs.ruby-lang.org/issues/8896#change-41756</a></p>
<p>Author: prijutme4ty (Ilya Vorontsov)<br>
Status: Open<br>
Priority: Normal<br>
Assignee:<br>
Category:<br>
Target version:</p>
<p>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:</p>
<p>def self.create(args={}, &block)<br>
new.set_attributes(args).tap(&block)<br>
end</p>
<p>but should use block_defined? to prevent #tap's failure.</p>
<p>I suggest to make tap with no block given just to return self and raise no errors.</p>
<p>--<br>
<a href="http://bugs.ruby-lang.org/" class="external">http://bugs.ruby-lang.org/</a></p>
</blockquote> Ruby master - Feature #8896: #tap with missing blockhttps://redmine.ruby-lang.org/issues/8896?journal_id=757052018-12-15T21:48:46Zshuber (Sean Huber)
<ul></ul><p><code>Kernel#tap</code> related: Allow <code>Kernel#tap</code> to be invoked with arguments like <code>Kernel#send</code> - <a href="https://bugs.ruby-lang.org/issues/15419" class="external">https://bugs.ruby-lang.org/issues/15419</a></p>
<p>If the <code>LocalJumpError</code> breaking change from this ticket is not an issue then it'd be pretty easy to add logic to that PR^ supporting it.</p> Ruby master - Feature #8896: #tap with missing blockhttps://redmine.ruby-lang.org/issues/8896?journal_id=955752021-12-23T23:43:57Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Project</strong> changed from <i>14</i> to <i>Ruby master</i></li></ul>