Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 47 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. def a(options)
  2.   options[:null] || false
  3. end
  4.  
  5. def b(options)
  6.   options[:null] if options.has_key?(:null)
  7. end
  8.  
  9.  
  10. options = {:null => true}
  11. p a(options) #=> false
  12. p b(options) #=> nil
  13. puts
  14.  
  15.  
  16. options = {:null => false}
  17. p a(options) #=> false
  18. p b(options) #=> false
  19. puts
  20.  
  21.  
  22. options = {:null => nil}
  23. p a(options) #=> false
  24. p b(options) #=> nil
  25. puts
  26.  
  27.  
  28. options = {}
  29. p a(options) #=> false
  30. p b(options) #=> nil
  31. puts
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