Completed
Push — master ( 8d5590...2463f1 )
by Borja
03:23
created

prof_impeds()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 3
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
c 1
b 0
f 0
1
# encoding: UTF-8
2
3 1
def grados
4
  %w(aprendiz artesano maestro)
5
end
6
7 1
def profes
8
  %w(alquimia inscripción taxidermia táctica
9
     encantamiento orfebrería carpintería
10
     política cetrería)
11
end
12
13 1
def load_recetas(id, prof)
14
  {
15
    id:       id,
16
    name:     prof,
17
    aprendiz: load_yaml("profesiones/#{prof}/aprendiz"),
18
    artesano: load_yaml("profesiones/#{prof}/artesano"),
19
    maestro:  load_yaml("profesiones/#{prof}/maestro")
20
  }
21
end
22
23 1
def profesions
24
  profesions = []
25
  profes.each_with_index do |prof, i|
26
    profesions << Profesion.new(load_recetas(i, prof))
27
  end
28
  profesions
29
end
30
31 1
def prof_impeds
32
  load_yaml('profesiones/imped')
33
end
34
35 1
def profesion(id) # TODO : This is not working
36
  profesions[id]
37
end
38