Gema.precio_venta()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 4
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
1
# Tipo de engarce basico
2 1
class Gema < Engarce
3 1
  def calidad
4
    gema_calidades.find { |g| (g['calibre'] - 1) == (id / 8) }
5
  end
6
7 1
  def precio_venta
8
    # Cost depends on calibre
9
    [10, 25, 50, 100, 250, 500, 50][calidad - 1] # TODO: Check this values
10
  end
11
end
12