Rotary encoders typically have a common terminal for the A and B channels and the pushbutton. This common terminal is normally connected to ground and the 3 outputs are sent to individual pins with pull-ups enabled.
However if you connect the common terminal to an analog pin, and via a 10k resistor to ground, then each of the other pins can be fed +5V via a different value resistor (say 4k7, 10k, 22k) then you will get a unique voltage at the analog pin for each of the 8 possible states I think...