Add note about Version constructor.

This commit is contained in:
Markus Reiter 2023-05-02 22:20:27 +02:00
parent ff71668f0a
commit 4bbf120630
No known key found for this signature in database
GPG Key ID: 245293B51702655B
2 changed files with 2 additions and 0 deletions

View File

@ -117,6 +117,7 @@ module OS
alias requires_popcnt? requires_nehalem_cpu? alias requires_popcnt? requires_nehalem_cpu?
# Represents the absence of a version. # Represents the absence of a version.
# NOTE: Constructor needs to called with an arbitrary macOS-like version which is then set to `nil`.
NULL = Version.new("10.0").tap { |v| v.instance_variable_set(:@version, nil) }.freeze NULL = Version.new("10.0").tap { |v| v.instance_variable_set(:@version, nil) }.freeze
end end
end end

View File

@ -736,5 +736,6 @@ class Version
end end
# Represents the absence of a version. # Represents the absence of a version.
# NOTE: Constructor needs to called with an arbitrary non-empty version which is then set to `nil`.
NULL = Version.new("NULL").tap { |v| v.instance_variable_set(:@version, nil) }.freeze NULL = Version.new("NULL").tap { |v| v.instance_variable_set(:@version, nil) }.freeze
end end