Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

module · Ruby 3.4

Gem::UserInteraction

include Gem::DefaultUserInteraction 10 instance methods

UserInteraction allows RubyGems to interact with the user through standard methods that can be replaced with more-specific UI methods for different displays.

Since UserInteraction dispatches to a concrete UI class you may need to reference other classes for specific behavior such as Gem::ConsoleUI or Gem::SilentUI.

Example:

Example
class X
  include Gem::UserInteraction

  def get_answer
    n = ask("What is the meaning of life?")
  end
end

Instance methods 10