jRuby / Rails if-else 与 AND/OR 的正确语法
对于具有多个约束的 IF 语句,Ruby 的正确语法是什么?
php 中的示例你可以这样做。
if(($something == $this) AND ($this == $that))
所以我正在寻找该语法的 Ruby 版本。我尝试搜索它,但由于它是常用词,并且大多数搜索引擎使用相同的词作为条件,所以我的搜索结果非常少。
What is the proper syntax with Ruby for an IF statement that has multiple constraints.
example in php you could do.
if(($something == $this) AND ($this == $that))
So I am looking for the Ruby rendition of that syntax. I try to search for it, but since its common words, and most search engines use the same words for conditionals my searches come up with very litte.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

你真的尝试过什么吗?
语法与 php 并没有那么远:
您可能应该阅读 Ruby 的 if 语法
Have you actually tried anything?
The syntax isn't that far from php:
You should probably read up on Ruby's if syntax