Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
Created August 25, 2011 14:51
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 isaacsanders/1170838 to your computer and use it in GitHub Desktop.
Save isaacsanders/1170838 to your computer and use it in GitHub Desktop.
Def within a def
class Example
def foo
def foo
:every_other_call
end
:first_call
end
end
ex = Example.new
ex.foo
#=> :first_call
ex.foo
#=> :every_other_call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment