In this screencast Dr Nic shows how a simple class snippet can be made smart and use embedded ruby code to derive the class name from the current file name.

link