Created
April 27, 2017 05:53
-
-
Save Sihui/b423fa590c65262d8fef0d5342fad895 to your computer and use it in GitHub Desktop.
For [Code Block, Proc, Lambda, and Closure in Ruby]() Raw
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
# Only -> | |
# takes argument outside of {} | |
->(arg) { puts arg } | |
# The rest | |
# takes argument in between || | |
{ |arg| puts arg } | |
proc do |arg| | |
puts arg | |
end | |
lambda { |arg| puts arg } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment