module Ciuchcia def self.polish_ending(n, endings) case (n % 10) when 1: n > 10 ? endings[2] : endings[0] when 2..4: endings[1] else endings[2] end end end