Created
June 19, 2014 15:17
-
-
Save tmcallister/b5b517ba6ca7276caa7c to your computer and use it in GitHub Desktop.
Methods. unit 1, section 7
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
# Example 1 | |
def add_two(some_integer) | |
result = some_integer + 2 | |
return result | |
end | |
# Example 2 | |
def add_two(some_integer) | |
result_integer = some_integer + 1 | |
result_integer = result_integer + 1 | |
return result_integer | |
end | |
# Example 3 | |
def add_two(some_integer) | |
result = some_integer.next.next | |
return result | |
end | |
# Example 4 | |
def add_two(some_integer) | |
some_integer.next.next | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment