Ho un array attributi come segue,Che cos'è l'oggetto Enumeratore? (Creato con stringa # gsub)
attributes = ["test, 2011", "photo", "198.1 x 198.1 cm", "Photo: Manu PK Full Screen"]
Quando faccio questo,
artist = attributes[-1].gsub("Photo:")
p artist
ottengo il seguente output nel terminale
#<Enumerator: "Photo: Manu PK Full Screen":gsub("Photo:")>
Ti chiedi perché sto ottenendo un oggetto enumeratore come output? Grazie in anticipo.
MODIFICA: Si prega di notare che invece di attributes[-1].gsub("Photo:", ""), I am doing attributes[-1].gsub("Photo:")
Quindi vorrei sapere perché l'oggetto enumeratore è tornato qui (mi aspettavo un messaggio di errore) e cosa sta succedendo.?
rubino - 1.9.2
Rotaie - 3.0.7