Created
March 5, 2015 06:42
-
-
Save gee-forr/518ed72b717bfd1c8fbf to your computer and use it in GitHub Desktop.
Return a value, or do something, then return a value
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
#!/usr/bin/env ruby | |
def var_or_do_then_var | |
nil || (puts 'I ran'; 'I returned') | |
end | |
out = var_or_do_then_var | |
puts "--#{out}--" # heh... puts out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment