irohiroki (Hiroki Yoshioka)
- Login: irohiroki
- Registered on: 10/22/2017
- Last sign in: 03/23/2018
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 1 | 0 | 1 |
Activity
03/30/2018
-
06:52 AM Ruby Feature #14625: yield_self accepts an argument, calling to_proc
- shevegen,
That's what I meant to say. Thank you. -
06:49 AM Ruby Feature #14625: yield_self accepts an argument, calling to_proc
- zverok,
Answer 1.
~~~ ruby
.yield_self(method :filter1)
~~~
is shorter than
~~~ ruby
.yield_self(&method(:filter1))
~~~
and doesn't have nested parens.
Answer 2: I don't really know about other methods, but there is...
03/23/2018
-
08:04 AM Ruby Feature #14625 (Open): yield_self accepts an argument, calling to_proc
- Currently, yield_self doesn't accept any argument other than a block.
But there are situations where I would like to pass a method object to yield_self.
e.g.
~~~ ruby
result = collection
.yield_self(&method(:filter1))
.yie...