Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Created December 27, 2011 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JoshCheek/1525394 to your computer and use it in GitHub Desktop.
Save JoshCheek/1525394 to your computer and use it in GitHub Desktop.
# http://stackoverflow.com/questions/8647320/ruby-use-condition-result-in-condition-block/8647391#8647391
prefix = nil
if /(?<prefix>.+)_path/ =~ "home_path" # !> named capture conflicts a local variable - prefix
puts prefix
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment