tengo una matriz atributos de la siguiente manera,¿Qué es el objeto Enumerator? (Creado con la cadena # gsub)
attributes = ["test, 2011", "photo", "198.1 x 198.1 cm", "Photo: Manu PK Full Screen"]
cuando hago esto,
artist = attributes[-1].gsub("Photo:")
p artist
i obtener la siguiente salida en el terminal
#<Enumerator: "Photo: Manu PK Full Screen":gsub("Photo:")>
¿Te preguntas por qué recibo un objeto enumerador como salida? Gracias por adelantado.
EDITAR: Tenga en cuenta que en lugar de attributes[-1].gsub("Photo:", ""), I am doing attributes[-1].gsub("Photo:")
¿Quiere saber por qué el objeto del enumerador ha regresado aquí (esperaba un mensaje de error) y qué está sucediendo?
Ruby - 1.9.2
carriles - 3.0.7