module Gem::UserInteraction

UserInteraction 允许 RubyGems 通过标准方法与用户交互,这些方法可以被替换为针对不同显示器的更具体的 UI 方法。

由于 UserInteraction 会分派到具体的 UI 类,您可能需要引用其他类来获取特定行为,例如 Gem::ConsoleUIGem::SilentUI

示例

class X
  include Gem::UserInteraction

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