diff --git a/README.md b/README.md index fc037d4..0182dfa 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ This project is an attempt to provide c-style enums for ruby. It's obviously imp Symbols are great. You should probably keep on using symbols in most of the places that you currently do. There are, however, certain situations that enums are better suited for. For instance: * A variable can take on a finite set of known, named, values. - > The set of values that a variable can take on define that variable's type. Rather than just scattering symbols throughout your code that modifes the variable, it is frequently helpful to encapsulate the type information in one place. An enum, being a lightweight, in-line class definition, is an ideal place to do this. Examples of this type of situation would be when you need to represent days-of-the-week or drink sizes available + > The set of values that a variable can take on define that variable's type. Rather than just scattering symbols throughout your code that modifes the variable, it is frequently helpful to encapsulate the type information in one place. An enum, being a lightweight, in-line class definition, is an ideal place to do this. Examples of this type of situation would be when you need to represent days-of-the-week or drink sizes available DayOfWeek = enum :sun, :mon, :tues, :wed, :thurs, :fri, :sat DrinkSize = enum :small, :medium, :large * A dual name/value representation is needed. This is particularly common when you have a set of possible values with an inherent ordering. - > Enums have the property of defining both names and values, so you can sometimes get the best of both worlds by using them. + > Enums have the property of defining both names and values, so you can sometimes get the best of both worlds by using them. DrinkSize = enum :small, :medium, :large DrinkSize::SMALL < DrinkSize::LARGE # true