How is the conditional operator (? :) used in Ruby?
? :
For example, is this correct?
<% question = question.size > 20 ? question.ques
A simple example where the operator checks if player's id is 1 and sets enemy id depending on the result
player_id=1 .... player_id==1? enemy_id=2 : enemy_id=1 # => enemy=2
And I found a post about to the topic which seems pretty helpful.