Created
December 27, 2011 22:46
-
-
Save JoshCheek/1525394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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