Skip to content

Instantly share code, notes, and snippets.

@sjmog
Created January 8, 2019 13:20
Show Gist options
  • Save sjmog/ae9088203b91ef2d2ece8f61b321ac3d to your computer and use it in GitHub Desktop.
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?
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