Skip to content

Instantly share code, notes, and snippets.

@iain
Created February 2, 2012 11:01
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 iain/1722900 to your computer and use it in GitHub Desktop.
Save iain/1722900 to your computer and use it in GitHub Desktop.
Kill me now!
def some_method(param)
foo = nil
if param
if param == "value"
foo = get_foo_somehow
else
foo = get_foo_some_other_way
end
unless foo
foo = find_foo
if foo
foo = foo.modify
else
foo = foo.modify_other
end
end
else
foo = find_foo_in_yet_another_way
foo = calculate_foo unless foo
end
return foo
end
@dkln
Copy link

dkln commented Feb 2, 2012

thankfully there is a return statement on line 21... that clears things up!

@fatum
Copy link

fatum commented Feb 2, 2012

Holy McConnell!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment