self == other -> boolRuby 2.4.0 から[permalink][rdoc][edit]self === other -> bool-
selfが 数値としてotherと等しければtrueを返し、そうでないときfalseを返します。otherが数値でないときはfalseを返します。Integerオブジェクトを左項とする比較演算子==および===はこのメソッドの呼び出しになります。- [PARAM]
other: - 比較対象の数値
- [RETURN]
-
selfとotherが等しい場合trueを返します。そうでなければfalseを返します。
p 1 == 2 # => false p 1 == 1.0 # => true p 1 == "1" # => false - [PARAM]