Code Duplication    Length = 7-7 lines in 2 locations

model/hero.rb 1 location

@@ 80-86 (lines=7) @@
77
    end
78
  end
79
80
  def get_weapon(weapon) # Analyze data structure
81
    case weapon.class.to_s
82
    when 'Hash'   then Arma.new(weapon)     # Ad-hoc item
83
    when 'Fixnum' then Arma.new(id: weapon) # Item mundano
84
    else Arma.new(id: 0) # Nil items
85
    end
86
  end
87
88
  def weapons
89
    if armas.class.to_s == 'Array'

model/renegado.rb 1 location

@@ 78-84 (lines=7) @@
75
    end
76
  end
77
78
  def get_weapon(weapon) # Analyze data structure
79
    case weapon.class.to_s
80
    when 'Hash'   then Arma.new(weapon)     # Ad-hoc item
81
    when 'Fixnum' then Arma.new(id: weapon) # Item mundano
82
    else Arma.new(id: 0) # Nil items
83
    end
84
  end
85
86
  def weapons
87
    if armas.class.to_s == 'Array'