We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a plan to support Set?
I am trying to use dry-types in place of Virtus in Grape. Currently, Set is supported because Virtus supports it.
I am think of the same interface as Array has:
PostStatuses = Types::Set.of(Types::Coercible::String)
The text was updated successfully, but these errors were encountered:
We'll need to generalize some internals for that. Maybe we could do it in 1.3
Sorry, something went wrong.
Are there any ideas about this feat ? I guess it can be very useful
@Alexxfrolov this is as simple as:
[4] pry(main)> Types::Set = Types.Constructor(Set, Set.method(:new)) => #<Dry::Types[Constructor<Nominal<Set> fn=Set.new>]> [5] pry(main)> Types::Set[["a", "a", "b", "c"]] => #<Set: {"a", "b", "c"}>
I'm not 100% sure we should have it in the lib though but we'll think about it.
No branches or pull requests
Is there a plan to support Set?
I am trying to use dry-types in place of Virtus in Grape. Currently, Set is supported because Virtus supports it.
I am think of the same interface as Array has:
The text was updated successfully, but these errors were encountered: