Created
July 15, 2022 07:05
-
-
Save fnordfish/82137e3017ae47a59a92d5a52eaad20f to your computer and use it in GitHub Desktop.
Dry-Types Coercible::Set like Coercible:Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coercible::Set = Types.Constructor( | |
Set, | |
->(a) { | |
# mock behavior of `Kernel.Array` | |
case a | |
when nil then Set.new | |
when Enumerable then Set.new(a) | |
else Set[a] | |
end | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment