dblock / ruby-enum

A handy way to define enums in Ruby.
MIT License
177 stars 23 forks source link

Value: default to key #28

Closed gi closed 3 years ago

gi commented 3 years ago

Allow define to optionally accept a value.

If no value is given, the value will default to the key:

class A
  include Ruby::Enum
  define :X
end

A::X == :X