You often see the Array shortcut in code…
%w(foo bar sed) # => ["foo", "bar", "sed"]
…but how many of the other Ruby Shortcuts are you aware of? Personally I knew about half of them.
Tags: Programming, Ruby, Shortcuts, Tips
You often see the Array shortcut in code…
%w(foo bar sed) # => ["foo", "bar", "sed"]
…but how many of the other Ruby Shortcuts are you aware of? Personally I knew about half of them.
Tags: Programming, Ruby, Shortcuts, Tips
This entry was posted on Wednesday, March 24th, 2010 at 3:50 am and is filed under Ruby. You can follow any comments to this entry through the RSS 2.0 feed. You can leave a comment, or trackback from your own site.
© 2012. jfine.org. Powered by WordPress, theme by WPShoppe, both tweaked by Jared Fine.
I’m partial to %w[foo bar sed] as the brackets are a bit more array-esque
Good call.