N
Nit Khair
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[0] 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 .
Also,
To be compatible with both 1.8 amd 1.9, would i use something like:
ch = str.respond_to?
rd ? str[0].ord : str[0]
or
str[0] is_a? Fixnum ? str[0] : str[0].ord
Anyone else doing such things?
Thanks.
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[0] 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 .
Also,
To be compatible with both 1.8 amd 1.9, would i use something like:
ch = str.respond_to?
or
str[0] is_a? Fixnum ? str[0] : str[0].ord
Anyone else doing such things?
Thanks.