New Favourite Line of Ruby

Not because it's actually useful (almost entirely the opposite, in fact), but because I keep finding slightly insane corners of the language. And also this would freak out a beginner despite doing nothing useful.

Anyway, today I learned that you can use this:

[1,2,3,4,5].method('inject').([],&->(x,y){x+[y]})

to return this:

[1,2,3,4,5]

I'm sorry.


EDIT

I've made it worse

%w(x y).method('inject').([],&->(x,y){x+[y]})

The method bit's a bit wordy, but we'll get there eventually.