Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Module#<=>

module <=> other_module → -1, 0, +1, or nil

Comparison—Returns -1, 0, +1 or nil depending on whether module includes other_module, they are the same, or if module is included by other_module.

Returns nil if module has no relationship with other_module, if other_module is not a module, or if the two values are incomparable.

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