Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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