Skip to content

Instantly share code, notes, and snippets.

@r00k
Created August 13, 2009 21:20
Show Gist options
  • Save r00k/167455 to your computer and use it in GitHub Desktop.
Save r00k/167455 to your computer and use it in GitHub Desktop.
# 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