Posts by user23807 • 21 points
1 post
-
2
votes2
answers647
viewsA: How to use Ruby blocks
You can create blocks using the keyword lambda. diga_ola = lambda {|nome| puts "Olá, #{nome}!" } diga_ola.call 'Fulano' # "Olá, Fulano!" This allows you to pass a block to a method: def…