lolmaus (Andrey Mikhaylov)
- Login: lolmaus
- Email: lolmaus@gmail.com
- Registered on: 03/13/2014
- Last sign in: 03/13/2014
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 0 | 1 | 1 |
Activity
03/13/2014
-
12:59 PM Ruby Feature #9635: Map a hash directly to a hash
- Ok, what i suggest is not a valid Ruby syntax. It should be
~~~
.hashy_map { |key, value| {key => value} }
~~~
which is hardly sweeter than
~~~
.map { |key, value| [key, value] }.to_h
~~~
and also goes against common pra... -
12:42 PM Ruby Feature #9635 (Closed): Map a hash directly to a hash
- There should be a way to directly map a hash to a hash.
The current way to do it is not very graceful:
~~~
{foo: 'foo', bar: 'bar'}.map { |key, value| [key.upcase, value.reverse] }.to_h # => { :FOO => 'oof', :BAR => 'rab' }
~...