Class: Level

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level) ⇒ Level


4
5
6
# File 'lib/Level.rb', line 4

def initialize(level)
  @level = level
end

Instance Attribute Details

#levelObject

Returns the value of attribute level


2
3
4
# File 'lib/Level.rb', line 2

def level
  @level
end

Instance Method Details

#get_levelObject


8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/Level.rb', line 8

def get_level
  level_disp = ""
  case @level
  when 1
    level_disp = :Beginner
  when 2
    level_disp = :Intermediate
  when 3
    level_disp = :Advanced
  else
    level_disp = :Beginner
  end
  level_disp
end

#get_num_charactersObject


38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/Level.rb', line 38

def get_num_characters
  num_of_characters = 4;
  case @level
  when 1
    num_of_characters = 4
  when 2
    num_of_characters = 6
  when 3
    num_of_characters = 8
  else
    num_of_characters = 4
  end
  num_of_characters
end

#get_num_colorsObject


23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/Level.rb', line 23

def get_num_colors
  num_of_colors = 4;
  case @level
  when 1
    num_of_colors = 4
  when 2
    num_of_colors = 5
  when 3
    num_of_colors = 6
  else
    num_of_colors = 4
  end
  num_of_colors
end