Skip to content

Instantly share code, notes, and snippets.

@paigeruten
Created July 28, 2010 08:05
Show Gist options
  • Save paigeruten/493731 to your computer and use it in GitHub Desktop.
Save paigeruten/493731 to your computer and use it in GitHub Desktop.
# Substitution with Hash (Ruby 1.9, not documented)
":(".gsub(/./, ':' => ';', '(' => ')') #=> ";)"
# The “assign first” operator
caterpillar_part ,= ["head", "body"]
caterpillar_part #=> "head"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment