What means "?" in ruby?

I want to know its real meaning and how to use it.

Another assertion question I've seen

assert product.valid? product.errors.full_messages and

assert product.valid?

But I can’t find the syntax for those who claim what the second argument of assert (product.errors.full_messages) means or is it an argument?

thanks

+3
source share
3 answers

Ruby uses special naming conventions for methods. This allows you to quickly identify the side effects that they may have, or the type of return.

, "!" "?" . , , , . ( )

  • "?" , . "is". ( lisp)
  • ! ", , , / .

, . , .

+11

, . - , (?) , ? ! .

+3

It is just a convention to put it in a method that returns a logical afaik. Instead of doing all this IsSomething.

+1
source

Source: https://habr.com/ru/post/1719258/


All Articles