Ruby 3.4 リファレンスマニュアル

instance method Integer#^

self ^ other -> IntegerRuby 2.4.0 から[permalink][rdoc][edit]

ビット二項演算子。排他的論理和を計算します。

[PARAM] other:
数値
p 1 ^ 1  # => 0
p 2 ^ 3  # => 1