Created
January 8, 2019 13:20
-
-
Save sjmog/ae9088203b91ef2d2ece8f61b321ac3d to your computer and use it in GitHub Desktop.
There's something wrong with this code, which means `print_selected` doesn't work. What is it?
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 Todo | |
def initialize(items) | |
@items = items | |
end | |
def print | |
print @items.join("\n") | |
end | |
def print_selected(index) | |
print @items[index] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment