Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Gem::Version#<=>

(untyped other) -> ::Integer?
<=>(other)

Compares this version with other returning -1, 0, or 1 if the other version is larger, the same, or smaller than this one. other must be an instance of Gem::Version, comparing with other types may raise an exception.

See also .new #approximate_recommendation .create #bump also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0