Archive for May 28th, 2008
commas in ruby hash literals
May 28th, 2008 •
tags: irb, ruby
# I didn't realize this was possible
# and I still don't know if I like it.
# However, there are reasons for this,
# like easy addition or moving of literal
# entries without thinking about commas
irb(main):001:0> {
irb(main):002:1* :foo => :bar,
irb(main):003:1* :baz => :bam,
irb(main):004:1* }
=> {:foo=>:bar, :baz=>:bam}