any
Any
A nefarious little library to ""safely"" break the type system and perform type erasure in Crystal
Installation
-
Add the dependency to your
shard.yml
:dependencies: any: gitlab: rymiel/any
-
Run
shards install
Usage
require "any"
erased_string = Any.new "Hello, world!"
puts erased_string.value(String) # => Hello, world!
erased_string.value(Int32) # Throws at runtime!
Contributing
- Fork it (https://gitlab.com/rymiel/any/-/forks/new)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Merge Request
Contributors
- Emilia Dreamer - creator and maintainer
Repository
any
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- almost 3 years ago
- February 11, 2022
License
MIT License
Links
Synced at
Fri, 22 Nov 2024 14:53:32 GMT
Languages