Code Duplication    Length = 7-7 lines in 4 locations

model/renegado.rb 2 locations

@@ 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'
@@ 70-76 (lines=7) @@
67
  end
68
69
  # Default-ed meta-methods
70
  def armour
71
    case armadura.class.to_s
72
    when 'Fixnum' then Armadura.new(id: armadura)
73
    when 'Hash'   then Armadura.new(armadura)
74
    else Armadura.new(id: 0)
75
    end
76
  end
77
78
  def get_weapon(weapon) # Analyze data structure
79
    case weapon.class.to_s

model/hero.rb 2 locations

@@ 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'
@@ 70-76 (lines=7) @@
67
  end
68
69
  # Default-ed meta-methods
70
  def armour
71
    case armadura.class.to_s
72
    when 'Fixnum' then Armadura.new(id: armadura)
73
    when 'Hash'   then Armadura.new(armadura)
74
    else Armadura.new(id: 0)
75
    end
76
  end
77
78
  def get_weapon(weapon) # Analyze data structure
79
    case weapon.class.to_s