If statement jRuby/Rails使用和/或的if-else的正确语法

If statement jRuby/Rails使用和/或的if-else的正确语法,if-statement,jruby,If Statement,Jruby,对于具有多个约束的IF语句,Ruby的正确语法是什么 你可以用php做一个例子 if(($something == $this) AND ($this == $that)) 所以我正在寻找这种语法的Ruby格式。我试图搜索它,但由于它的常用词,而且大多数搜索引擎都使用相同的词作为条件句,我的搜索结果很少。你真的尝试过什么吗 语法与php并不遥远: if ((2 % 2 == 0) and (3 % 2 == 1)) puts "2 is even, 3 is not" end 你也许应该

对于具有多个约束的IF语句,Ruby的正确语法是什么

你可以用php做一个例子

if(($something == $this) AND ($this == $that))

所以我正在寻找这种语法的Ruby格式。我试图搜索它,但由于它的常用词,而且大多数搜索引擎都使用相同的词作为条件句,我的搜索结果很少。

你真的尝试过什么吗

语法与php并不遥远:

if ((2 % 2 == 0) and (3 % 2 == 1))
  puts "2 is even, 3 is not"
end
你也许应该好好读一读


但是你应该使用

你搜索过“ruby操作符”吗?不,不幸的是,这个词避开了我,我当时太累了。
if something == this && this == that
if something == this and this == that