Created
August 13, 2009 21:20
-
-
Save r00k/167455 to your computer and use it in GitHub Desktop.
This file contains 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
# Returns just the numbers from the phase attribute | |
def display_phase | |
case phase | |
when /(\d).*(\d)/ | |
$1 + ' / ' + $2 | |
when /(\d)/ | |
$1 | |
when nil | |
'' | |
else | |
# Can be "N/A" | |
phase | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment