Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Integer#===

self == other -> true or false

Returns true if self is numerically equal to other; false otherwise.

Example
1 == 2     #=> false
1 == 1.0   #=> true

Related: Integer#eql? (requires other to be an Integer).

Integer#=== is an alias for Integer#==.

See also #== #> #<=> #>= also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0