class Integer def [](i) return self << i endendn = 5 # 101# Сдвигаем влево на 1n1 = n[1]# n1 is 10 (1010)# Сдвигаем вправо на 2n2 = n[-2]# n2 is 1puts "n1 is #{n1}"puts "n2 is #{n2}"