Pergunta

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

Foi útil?

Solução

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 em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top