I need to make a rather important design in my 1.8 application, so i
don’t have too much rework to do when i want to port to 1.9.
I understand that in 1.9 we would use String.ord for cases like a or
?a (getting ascii value).
But what about ?\C-a or ?\M-a (control and meta keys). Is there a
workaround for them?
Sorry, I don’t have 1.9, so cant try out “\C-a”.ord .
To be compatible with both 1.8 amd 1.9, would i use something like:
ch = str.respond_to? :ord ? str.ord : str
str is_a? Fixnum ? str : str.ord
Anyone else doing such things?