Class: Settlers::UI
- Inherits:
-
Object
- Object
- Settlers::UI
- Defined in:
- lib/settlers/ui.rb
Instance Method Summary collapse
- #choose_server(list) {|case list.size when 0 abort 'No servers to choose from.' when 1 list.first else choose_from_many(list) end| ... } ⇒ Object
-
#initialize ⇒ UI
constructor
A new instance of UI.
Constructor Details
#initialize ⇒ UI
Returns a new instance of UI.
5 6 7 |
# File 'lib/settlers/ui.rb', line 5 def initialize @console = HighLine.new end |
Instance Method Details
#choose_server(list) {|case list.size when 0 abort 'No servers to choose from.' when 1 list.first else choose_from_many(list) end| ... } ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/settlers/ui.rb', line 9 def choose_server(list) yield case list.size when 0 abort 'No servers to choose from.' when 1 list.first else choose_from_many(list) end end |