-
-
Save marocchino/4656167 to your computer and use it in GitHub Desktop.
This file contains 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
def some_method | |
return false if aaaaaaaaaaaa && bbbbbbbbbbbb | |
return false if cccccccccccc || dddddddddddd | |
return false if eeeeeeeeeeee && ffffffffffff | |
do_something | |
end |
This file contains 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
def some_method | |
if (aaaaaaaaaaaa && bbbbbbbbbbbb) || | |
(cccccccccccc || dddddddddddd) || | |
(eeeeeeeeeeee && ffffffffffff) | |
false | |
else | |
do_something | |
end | |
end |
This file contains 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
def some_method | |
return false if [aaaaaaaaaaaa && bbbbbbbbbbbb, | |
cccccccccccc || dddddddddddd, | |
eeeeeeeeeeee && ffffffffffff].any? | |
do_something | |
end |
This file contains 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
def some_method | |
if [aaaaaaaaaaaa && bbbbbbbbbbbb, | |
cccccccccccc || dddddddddddd, | |
eeeeeeeeeeee && ffffffffffff].any? | |
false | |
e | |
do_something | |
end |
This file contains 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
def some_method | |
if some_condition? | |
false | |
else | |
do_something | |
end | |
end | |
def some_condition? | |
(aaaaaaaaaaaa && bbbbbbbbbbbb) || | |
(cccccccccccc || dddddddddddd) || | |
(eeeeeeeeeeee && ffffffffffff) | |
end |
This file contains 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
def some_method | |
if some_condition? | |
false | |
else | |
do_something | |
end | |
end | |
def some_condition? | |
error_code.present? | |
end | |
def error_code | |
@error_code ||= if aaaaaaaaaaaa && bbbbbbbbbbbb | |
1 | |
elsif cccccccccccc || dddddddddddd | |
2 | |
elsif eeeeeeeeeeee && ffffffffffff | |
3 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment