I'm a non-programmer hoping to learn ruby by "scratching an itch"
and looking at examples.

I've been exploring the IS-101-compliant voicemodem in my debian
box, and have found it's simple to connect the modem to an unused
phone line and send tones from any phone on that line to be
displayed by a terminal emulation program.  Now I'd like to turn
the infrastructure into an intelligent doorbell/intercom system.

For phase 1, what I'd like to do is initialize the modem:
AT Z
AT +FCLASS=8
AT X3L2D

And then the software needs to just sit & listen to /dev/modem for
valid tone sequences (4 digits or so) and respond by playing the
corresponding recorded messages out the voicemodem and soundcard.

(When keys are pressed on the phone, they show up in the terminal
window like so:  1~2~3~4~5~6~7~8~9~*~0~#~    This seems to work
very reliably, no matter what the duration of the keypress: I
haven't had any errors or double plays.)

Looks like this is how I talk to the sound card in ruby...
system("aplay dingdong.wav")

but I haven't found an example of how to listen/talk to the modem.

Mainly what I'm looking for is code samples and advice on how to
structure the prog so it's technically elegant & shows OO Ruby at
its best, rather than looking like stuff perversely dragged over
from BASIC.

TIA