模块 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