instance method yes?

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

yes?(question)

Helper to test if the user says yes(y)?

Example

freeze! if yes?("Should I freeze the latest Rails?")

Parameters

question req
Source
# File railties/lib/rails_generator/generators/applications/app/template_runner.rb, line 341
    def yes?(question)
      answer = ask(question).downcase
      answer == "y" || answer == "yes"
    end

Defined in railties/lib/rails_generator/generators/applications/app/template_runner.rb line 341 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::TemplateRunner

Type at least 2 characters to search.

↑↓ navigate · open · esc close