Ruby enumerated list
Use like this:
enum :FIRST, :SECOND, :THIRD
module Util # Basic enumerated list. def enum(*symbols) # Start out the count at 0. i = 0 # Define a constant for each symbol in symbols, assigning it the current value # of i. symbols.each { |s| const_set(s, i);i += 1 } end end