I'd like to know if there is a simpler way to do this condition in ruby
My Condition :
a = params[:smth].to_s == 'foo' ? 'foo2' : params[:smth].to_s
The problem of that condition, that reek throw warning of using params[:smth]
2 times, there is one possibility to assign params[:smth]
to variable, but maybe you know smarter way?
I'd probably write it like this: