Re:Dropbox dives into CoffeeScript
by alinajaf on Thursday September 13, 2012 @05:27PM
(#4518719)
Just another datapoint, but contrary to the other comments here I find your reduce example a lot more readable than the original. This could be because it's fairly idiomatic ruby.
[ Parent
| on HN ]
For me this in idiomatic ruby would be:
original_style = element.style.only('top', 'left', 'width', 'height')
Or if you do not want to rely on ActiveSupport: original_style = Hash[%w(top left width height).map{ |p| [p, element.style[p]] }]