Skip to content

Instantly share code, notes, and snippets.

@Papillard
Created July 13, 2017 09:10
Show Gist options
  • Save Papillard/313abcc4be13dc6ee1fbcbef62ba5f94 to your computer and use it in GitHub Desktop.
Save Papillard/313abcc4be13dc6ee1fbcbef62ba5f94 to your computer and use it in GitHub Desktop.
Playing with blocks
def greet(first_name, last_name)
full_name = "#{first_name.capitalize} #{last_name.capitalize}"
yield(full_name)
end
greet("alice", "clavel") do |name|
puts "Hallo freuilein #{name}"
end
greet("alice", "clavel") do |name|
puts "Bonjour mademoiselle #{name}"
end
greet("alice", "clavel") do |name|
puts "Hola senorita #{name}"
end
@dolisy
Copy link

dolisy commented Jul 13, 2017

Fräulein

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment