Class: RubyWarrior::UI
- Inherits:
-
Object
- Object
- RubyWarrior::UI
- Defined in:
- lib/ruby_armor/ruby_warrior_ext/ui.rb
Class Attribute Summary collapse
-
.proxy ⇒ Object
Returns the value of attribute proxy.
Class Method Summary collapse
- .ask(msg) ⇒ Object
- .choose(item, options) ⇒ Object
- .gets ⇒ Object
- .print(msg) ⇒ Object
- .puts(msg) ⇒ Object
- .puts_with_delay(msg) ⇒ Object
- .request(msg) ⇒ Object
Class Attribute Details
.proxy ⇒ Object
Returns the value of attribute proxy.
4 5 6 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 4 def proxy @proxy end |
Class Method Details
.ask(msg) ⇒ Object
27 28 29 30 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 27 def ask(msg) print msg true end |
.choose(item, options) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 32 def choose(item, ) response = .first if response.kind_of? Array response.first else response end end |
.gets ⇒ Object
18 19 20 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 18 def gets "" end |
.print(msg) ⇒ Object
14 15 16 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 14 def print(msg) proxy.print msg end |
.puts(msg) ⇒ Object
6 7 8 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 6 def puts(msg) print msg + "\n" end |
.puts_with_delay(msg) ⇒ Object
10 11 12 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 10 def puts_with_delay(msg) puts msg end |
.request(msg) ⇒ Object
22 23 24 25 |
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 22 def request(msg) print msg true end |