Class: Output

Inherits:
Object
  • Object
show all
Defined in:
lib/Output.rb

Class Method Summary collapse

Class Method Details

.animate_prompt(output) ⇒ Object


6
7
8
9
10
11
# File 'lib/Output.rb', line 6

def self.animate_prompt(output)
  output.split("").each do |x|
    sleep(0.05)
    print x.red.bold
  end
end

.display_about_gameObject


30
31
32
33
34
35
36
37
# File 'lib/Output.rb', line 30

def self.display_about_game
  puts Messages::ABOUT_GAME.bold
  puts Messages::PRESS_RETURN.green.bold
  gets
  puts Messages::CONSOLE_SEPERATOR.bold


end

.display_game_instructionsObject


17
18
19
20
21
22
# File 'lib/Output.rb', line 17

def self.display_game_instructions
  puts Messages::GAME_INSTRUCTION.bold
  puts Messages::PRESS_RETURN.green.bold
  gets
  puts Messages::CONSOLE_SEPERATOR.bold
end

.display_play_instruction(colors_key, colors_value) ⇒ Object


39
40
41
42
43
44
45
# File 'lib/Output.rb', line 39

def self.display_play_instruction(colors_key, colors_value)
  keys = ""
  values = ""
  colors_key.each{|x| keys << "#{x}, "}
  colors_value.each{|x| values << "#{x}, " }
  puts Messages::IN_GAME_INSTRUCTION.bold % [keys, values]
end

.display_start_messageObject


13
14
15
# File 'lib/Output.rb', line 13

def self.display_start_message
  puts Messages::ACTION.green.bold
end

.exit_gameObject


24
25
26
27
28
# File 'lib/Output.rb', line 24

def self.exit_game
  puts Messages::EXIT_GAME.bold
  puts Messages::CONSOLE_SEPERATOR.bold
  exit
end

.write(message, args = []) ⇒ Object


47
48
49
# File 'lib/Output.rb', line 47

def self.write(message, args = [])
  print (message % args).bold
end

.write_line(message, args = []) ⇒ Object


51
52
53
# File 'lib/Output.rb', line 51

def self.write_line(message, args = [])
  puts (message % args).bold
end

.write_top_ten(list) ⇒ Object


55
56
57
# File 'lib/Output.rb', line 55

def self.write_top_ten(list)
  
end