-
-
Save enebo/005c4c55ddda58417e143b8accbb354e to your computer and use it in GitHub Desktop.
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
def [](a, b, c: 4) | |
p a, b, c | |
end | |
# public :[] # TR messes up visibility | |
self[1, c: 2] # Errors with arity error | |
self[1, c: 2] ||= 3 # MAGIC! it works and makes c: 2 bind to variable b | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment