Skip to content

Instantly share code, notes, and snippets.

@tmcallister
Created June 19, 2014 15:17
Show Gist options
  • Save tmcallister/b5b517ba6ca7276caa7c to your computer and use it in GitHub Desktop.
Save tmcallister/b5b517ba6ca7276caa7c to your computer and use it in GitHub Desktop.
Methods. unit 1, section 7
# 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