Skip to content

Instantly share code, notes, and snippets.

@barangerbenjamin
Created February 1, 2024 20:52
Show Gist options
  • Save barangerbenjamin/7c625266c18af6555424963b48b86aad to your computer and use it in GitHub Desktop.
Save barangerbenjamin/7c625266c18af6555424963b48b86aad to your computer and use it in GitHub Desktop.
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