Last active
December 22, 2015 15:19
-
-
Save kossnocorp/6491700 to your computer and use it in GitHub Desktop.
How to refactor methods like this one?
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
def activity_status | |
if currently_working? | |
'working' | |
elsif worked_recently? | |
'active' | |
elsif has_activity? | |
'inactive' | |
elsif signed_in_at_least_once? | |
'no_activity' | |
else | |
'never_sign_in' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although above solutions are good, however i add new style for variability: