Created
March 28, 2020 14:03
Star
You must be signed in to star a gist
This file contains 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
module TildeCount | |
refine Enumerable do | |
alias ~@ count | |
end | |
end | |
using TildeCount | |
~[] | |
#=> 0 | |
~{} | |
#=> 0 |
This file contains 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
module TildeSize | |
[Array, Hash, Range].each do |sized_class| | |
refine sized_class do | |
alias ~@ size | |
end | |
end | |
end | |
using TildeSize | |
~[] | |
#=> 0 | |
~{} | |
#=> 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment