Created
October 11, 2013 14:35
-
-
Save adriand/6935723 to your computer and use it in GitHub Desktop.
Ruby case/when for class
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
# this does not work: | |
case @object.class | |
when ModelHome then path_for_model_home | |
end | |
# this works: | |
case @object | |
when ModelHome then path_for_model_home | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment