Module: LibGems::UserInteraction

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

Methods included from DefaultUserInteraction

ui, #ui, ui=, #ui=, use_ui, #use_ui

Instance Method Details

#methnameObject

: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