Created
July 21, 2018 21:17
-
-
Save jaymcgavren/062f3d6b8a0980da7628bc4e2e15071a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Methods are lopsided. Has to be a more aesthetic version of this...