Created
October 11, 2016 16:39
-
-
Save aleandros/777b1a0d07e19bf25dc7ce2b7dcccad7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 not_much(&action) # Convert method's block into a proc | |
| action.call | |
| end | |
| action = proc { puts 'hi' } | |
| not_much &action # Convert proc into method's block | |
| #=> It prints | |
| # hi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment