Refactoring Ruby: DRY up your Domain Models Using a Struct Table
It’s very usual for an application to have some sort of enum type, we usually put them in model or some sort of class with a property name representing it’s meaning to avoid magic value. Then more information will be added, and it becomes harder and harder to understand since those data can also be referenced from other places outside of that class. This article helps us DRY (Don’t Repeat Yourself) that. It also has some great rules about naming. Check it out!