Module: LibGems::UserInteraction
- Includes:
- DefaultUserInteraction
- Included in:
- Builder, Command, CommandManager, DependencyInstaller, DocManager, Format, Indexer, Installer, RemoteFetcher, Server, SourceIndex, SourceIndex, SourceInfoCache, SpecFetcher, Uninstaller, Validator
- Defined in:
- lib/libgems/user_interaction.rb
Overview
Make the default UI accessable without the “ui.” prefix. Classes including this module may use the interaction methods on the default UI directly. Classes may also reference the ui and ui= methods.
Example:
class X
include LibGems::UserInteraction
def get_answer
n = ask("What is the meaning of life?")
end
end
Instance Method Summary collapse
-
#methname ⇒ Object
:method: terminate_interaction.
Methods included from DefaultUserInteraction
ui, #ui, ui=, #ui=, use_ui, #use_ui
Instance Method Details
#methname ⇒ Object
:method: terminate_interaction
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/libgems/user_interaction.rb', line 111 [:alert, :alert_error, :alert_warning, :ask, :ask_for_password, :ask_yes_no, :choose_from_list, :say, :terminate_interaction ].each do |methname| class_eval %{ def #{methname}(*args) ui.#{methname}(*args) end }, __FILE__, __LINE__ end |