Pregunta

How puts variable in iterators code Ruby EX: (1,2,3).select { |v| puts v > 2}

¿Fue útil?

Solución

Seems syntax error, I think you want something like this

[1,2,3].select { |v| puts v > 2 }

output would be :

false

false

true

Take a look here

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top