Skip to content
instance method

Gem::Platform#===

(untyped other) -> bool
===(other)

Does other match this platform? Two platforms match if they have the same CPU, or either has a CPU of ‘universal’, they have the same OS, and they have the same version, or either one has no version

Additionally, the platform will match if the local CPU is ‘arm’ and the other CPU starts with “armv” (for generic 32-bit ARM family support).

Of note, this method is not commutative. Indeed the OS ‘linux’ has a special case: the version is the libc name, yet while “no version” stands as a wildcard for a binary gem platform (as for other OSes), for the runtime platform “no version” stands for ‘gnu’. To be able to distinguish these, the method receiver is the gem platform, while the argument is the runtime platform.

See also #== #=~ .version_match #deconstruct also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0