dblock / ruby-enum

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

`values` class method does not read inherited enums #27

Closed gi closed 3 years ago

gi commented 3 years ago

The values class method does not inherit the defined enum values from the parent class.

class A
  include Ruby::Enum
  define :X, 'X'
end

class B < A
  include Ruby::Enum
  define :Y, 'Y'
end

I would expect:

B.values() == [B::X, B::Y]

yet

B.values() == [B::Y]
dblock commented 3 years ago

Yep, looks like it. Would love a fix!