Skip to content

Instantly share code, notes, and snippets.

@charlietanksley
Created January 29, 2013 00:17
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 charlietanksley/4660535 to your computer and use it in GitHub Desktop.
Save charlietanksley/4660535 to your computer and use it in GitHub Desktop.
Ruby idioms?
def example(arg=nil)
a = [1, 2]
return a.reverse if arg
a
end
# OR
def example(arg=nil)
a = [1, 2]
if arg
a = a.reverse
end
a
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment