-
-
Save jmdeldin/0a4654d3f95dfa4d3dcc to your computer and use it in GitHub Desktop.
Blocks without subjects
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 foo(subject, &blk) | |
p blk.call(subject) | |
end | |
# works | |
foo("blah") do |subj| | |
subj.upcase | |
end | |
# what I want to work | |
foo("blah") do | |
upcase | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment