Created
November 2, 2017 03:47
-
-
Save dkinzer/abf3f9423ad8e2c270bf750c20049a1a 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 block_to_lambda(block = lambda {}) | |
if block_given? | |
block = lambda { yield } | |
end | |
puts block.inspect | |
end | |
block_to_lambda {} | |
# Returns: #<Proc:0x00007fceeba0ed50@test_block.rb:49 (lambda)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment