Created
February 1, 2024 20:52
-
-
Save barangerbenjamin/7c625266c18af6555424963b48b86aad 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 PostsView | |
def display(posts) | |
posts.each do |post| | |
# We display the id so the user can tell us which post they want to update/delete/upvote | |
puts "#{post.id}. #{post.title} - #{post.url} | #{post.votes}" | |
end | |
end | |
def ask_for(question) | |
puts question | |
gets.chomp | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment