I am looking for documentation on this functionality in ruby.
104 == ?g
Clearly it returns the numeric value of 'g'. Why would I use this feature I can not find documentation about? Speed..
n = 5000000 => 5000000
Benchmark.bm do |x|
x.report { 0.upto(n) do 104 == ?g end}
x.report { 0.upto(n) do "g" == "g" end }
x.report { 0.upto(n) do "g".eql?("g") end}
end
I am looking around my small set of books and the online documentation and have not found anything. I must admit I am unsure how to search for this.
I found the answer to my ruby code question. I found the documentation for assignment using *.
*x = one,two,three
one,two,three = *x