Last active
October 24, 2021 18:26
-
-
Save romanblanco/85f439022da033466ec0d7ea934b62ed 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 func(string1, string2, block) | |
string = string1 + " " + string2 | |
puts "\#1: #{string}" | |
block.call(string, 'here') | |
end | |
# => :func | |
proc = Proc.new { |a, b| puts "\#2: #{a}, #{b}" } | |
func "calling", "function", proc | |
# #1: calling function | |
# #2: calling function, here | |
# => nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment