A ruby method to convert number from binary to decimal