Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Gem::StreamUI#ask_yes_no

ask_yes_no(question, default = nil)

Ask a question. Returns a true for yes, false for no. If not connected to a tty, raises an exception if default is nil, otherwise returns default.