Topic: Question about ? (.nil?, .blank?, .include?)
What's the best way to explain what the "?" question mark does in ruby?
Take for instance this snippet of a view
<%= @user.name unless @user.name.nil? %>
To me that says "print the name of the user instance variable unless the name of the user instance variable is nil (or is it?)"
The ? seems to complicate things since it seems to me that you could just use
<%= something.do unless something.do.nil %>
"Do something unless do is nil."
Does the ? return true or false? Is the first example really saying "print the name of the user instance variable unless I(ruby) evaluate the name to be nil in which case return false"
I looked through "Why's" guide since he does a good job of explaining this kinda stuff but only found a brief little bit about it.