Conditions | 1 |
Total Lines | 10 |
Lines | 10 |
Ratio | 100 % |
Changes | 0 |
1 | # Heros filtering and searching methods |
||
3 | View Code Duplication | def heros |
|
|
|||
4 | total_heros = Dir['./data/heroes/*'].length |
||
5 | [*0..(total_heros - 1)].map do |i| |
||
6 | h = load_yaml("/heroes/#{i}") |
||
7 | h['nivel'] = 1 unless h['nivel'] |
||
8 | h['ciudad'] = 'Jadessvärd' unless h['ciudad'] |
||
9 | h['id'] = i |
||
10 | Hero.new(h) |
||
11 | end |
||
12 | end |
||
13 | |||
69 |