You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug but a "nice to have". Given an enum type like MyEnum = Types::String.enum('foo', 'bar'), when I want to iterate over the values, I'm doing it with MyEnum.values.each, but it would be nice if the Enum type had the each_value method similar to a Hash object.
To Reproduce
Run the following lines in an IRB session with the dry-types gem installed:
require'dry-types'MyEnum=Types::String.enum('foo','bar')MyEnum.each_value{ |value| putsvalue}# Throws a NoMethodError
Expected behavior
It would be nice if Dry::Types::Enum mimics the interface of a Hash object and implements the each_value method.
Describe the bug
This is not a bug but a "nice to have". Given an enum type like
MyEnum = Types::String.enum('foo', 'bar')
, when I want to iterate over the values, I'm doing it withMyEnum.values.each
, but it would be nice if the Enum type had theeach_value
method similar to a Hash object.To Reproduce
Run the following lines in an IRB session with the dry-types gem installed:
Expected behavior
It would be nice if
Dry::Types::Enum
mimics the interface of a Hash object and implements theeach_value
method.My environment
The text was updated successfully, but these errors were encountered: