The metallicity-luminosity relationship of dwarf irregular galaxies - II. A new approach