Safe (Algebraic) Union Data Types (With Enumerated Variants)
safedata gem / library - safe (algebraic) union data types with enumerated variants
Usage
To be done
What about Safe Enumeration (Integer) Types?
Yes, yes, yes. The Enum
class from the enums library gets auto-required.
Use like:
Enum.new( :Color, :red, :green, :blue )
enum :Color, :red, :green, :blue
enum :Color, [:red, :green, :blue]
See the enums library documentation for more »
License

The safedata
scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.
Send them along to the wwwmake forum.
Thanks!