README.rdoc in enumerate_it-0.7.10 vs README.rdoc in enumerate_it-0.7.11
- old
+ new
@@ -68,9 +68,17 @@
* You can retrieve a list with values for a group of enumeration constants.
RelationshipStatus.values_for %w(MARRIED SINGLE) # [2, 1]
+* You can retrieve the value for a specific enumeration constant:
+
+ RelationshipStatus.value_for("MARRIED") # 2
+
+* You can retrieve the symbol used to declare a specific enumeration value:
+
+ RelationshipStatus.key_for(RelationshioStatus::MARRIED) # :married
+
* You can manipulate the hash used to create the enumeration:
RelationshipStatus.enumeration # returns the exact hash used to define the enumeration
You can also create enumerations in the following ways: