stardiviner
11/4/2012 - 3:11 AM

Ruby two style symbol key hash

Ruby two style symbol key hash

# symbol hash 1
hash1 = {
  :cello => 'string',
  :drum  => 'prec'
}

puts "echo #{hash1[:cello]}"

# symbol hash 2
hash2 = {
  cello: 'string',
  drum: 'prec'
}

puts "echo #{hash1[:cello]}"