These are the binary bits that you're pulling off. Another way to see this is using to_s
with an argument indicating the desired base.
>> 789.to_s(2)
=> "1100010101"
String indexing is from left-to-right, so you can't compare []
on the string, but note how (from right-to-left) the digits are 1, 0, 1.
Here's the docs if you're interested: http://ruby-doc.org/core-1.9.3/Fixnum.html#method-i-5B-5D