Created
July 26, 2018 01:14
-
-
Save sparr/65452bafac7303cf3b3bab509b58d64c to your computer and use it in GitHub Desktop.
"interning empty string" when an empty string should have been caught
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 convert(value) | |
case value | |
when Symbol, '' # can't intern an empty string | |
value | |
when String | |
value.intern | |
when true | |
:true | |
when false | |
:false | |
else | |
value.to_s.intern # <-- how can this be throwing "interning empty string"?? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem solved.
nil
is the value in question.