Skip to content

Instantly share code, notes, and snippets.

@jaymcgavren
Created July 21, 2018 21: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 jaymcgavren/062f3d6b8a0980da7628bc4e2e15071a to your computer and use it in GitHub Desktop.
Save jaymcgavren/062f3d6b8a0980da7628bc4e2e15071a to your computer and use it in GitHub Desktop.
class Recursor
attr_accessor :counter
def initialize
self.counter = 0
end
def a
return b + "a"
end
def b
self.counter += 1
return c + "b"
end
def c
return "c" if counter > 10
return a + "c"
end
end
puts Recursor.new.a
@jaymcgavren
Copy link
Author

Methods are lopsided. Has to be a more aesthetic version of this...

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