Skip to content

Instantly share code, notes, and snippets.

@iNecas
Created February 1, 2011 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iNecas/805721 to your computer and use it in GitHub Desktop.
Save iNecas/805721 to your computer and use it in GitHub Desktop.
Grouping block arguments example
pscs = {
["Brno", "Hradecká"] => [61200,62100],
["Brno", "Merhautova"] => [61300,61400],
["Brno", "Nezamyslova"] => [61500,63600],
}
pscs.each do |(city, street), street_pscs|
puts "#{street} in #{city} has following PSCs: #{street_pscs.join(", ")}"
end
# Output:
# Hradecká in Brno has following PSCs: 61200, 62100
# Nezamyslova in Brno has following PSCs: 61500, 63600
# Merhautova in Brno has following PSCs: 61300, 61400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment