Ruby conversion of RPi.GPIO Python module