Class: RubyWarrior::UI

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_armor/ruby_warrior_ext/ui.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.proxyObject

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, options)
  response = options.first
  if response.kind_of? Array
    response.first
  else
    response
  end
end

.getsObject



18
19
20
# File 'lib/ruby_armor/ruby_warrior_ext/ui.rb', line 18

def gets
  ""
end


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