Skip to content

Instantly share code, notes, and snippets.

@gee-forr
Created March 5, 2015 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gee-forr/518ed72b717bfd1c8fbf to your computer and use it in GitHub Desktop.
Save gee-forr/518ed72b717bfd1c8fbf to your computer and use it in GitHub Desktop.
Return a value, or do something, then return a value
#!/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