EnumeratedType lets you create enumerated types like this:

  class OutputType < EnumeratedType
    AUTODETECT
    UNKNOWN
    NOSOUND
    WAVWRITER
    DSOUND
    WINMM
    ASIO
    OSS
    ALSA
    ESD
    SOUNDMANAGER
    COREAUDIO
    XBOX
    PS2
    GC
    XBOX360
    PSP
  end

If you want to start with a different integer than 0, you can just do:

  class OutputType < EnumeratedType
    start 15
    AUTODETECT
    ...
  end

You can also use start anywhere in the list, to have subsequent constants enumerated starting with the given value.

Author(s)

  • James Buck
Methods
Public Class methods
const_missing(sym) [ source ]
start(n) [ source ]