SHARE
TWEET

Untitled

a guest Apr 21st, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def beautify_name(first_name, last_name)
  2.   full_name = "#{first_name.capitalize} #{last_name.upcase}"
  3.   yield(full_name)
  4. end
  5.  
  6. message = beautify_name("john", "lennon") do |full_name|
  7.   "Greetings #{full_name}, you look quite fine today!"
  8. end
  9.  
  10. puts message # => "Greetings John LENNON, you look quite fine today!"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top