Created
December 31, 2017 17:02
-
-
Save rachidcalazans/a28029b603a4f1a69830b59cd84469be to your computer and use it in GitHub Desktop.
Example I refactored for the Post - avoiding-conditionals
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
def render_msg(state) | |
state_msgs = { | |
in_progress: 'In Progress', | |
done: 'Done', | |
on_review: 'On Review' | |
} | |
state_msgs[state] | |
end | |
render_msg(:in_progress) #=> "In Progress" | |
render_msg(:done) #=> "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment