Skip to content

Instantly share code, notes, and snippets.

@keithcelt
Created June 21, 2018 18:41
Show Gist options
  • Save keithcelt/7b293aa0470c7dc699e9120b361e66fd to your computer and use it in GitHub Desktop.
Save keithcelt/7b293aa0470c7dc699e9120b361e66fd to your computer and use it in GitHub Desktop.
Test conditionals in Ruby
def a
puts "hi" and return :hi if true
end
def b
(puts "hi" and return :hi) if true
end
def c
puts "hi" && return(:hi) if true
end
def d
(puts "hi" && return(:hi)) if true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment