Thanks
( @botp: qu not "who do I expand"!  ;)
Am 13.02.2016 15:08 schrieb "Samuel Brando" <gb.samuel / gmail.com>:

> You can write (4 if b == 5).
>
> If the condition evaluates to false, the expression under parenthesis will
> evaluate to nil. If this is a call to puts, it will print a blank line. If
> that is not OK you can do:
>
> p *[a, (4 if b == 5), c].compact
>
> So, this builds an array with the arguments you want to pass to p. The
> compact call removes eventual Nils. The * operator (splash op) expands the
> array elements as actual arguments of the method call. Pretty ugly, though,
> and more verbose than your original version.
>
> Samuel B
>
>
> Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>
>
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>