1

Possible Duplicate:
Enums in Ruby

How do you declare something like

public enum fruit {
    mango ("mango", 1),
    banana ("banana", 2),
    apple ("apple", 3)

    private fruit(String name, int index) {
        ....
    }
}

I would like to show the strings in the user interface, but would like to store the integers in the database.

Community
  • 1
  • 1
user339108
  • 12,123
  • 32
  • 79
  • 112

0 Answers0