4件ヒット
[1-4件を表示]
(0.129秒)
クラス
-
Gem
:: Version (4)
検索結果
先頭4件
-
Gem
:: Version # version -> String (27946.0) -
バージョン情報を文字列として返します。
バージョン情報を文字列として返します。
//emlist[][ruby]{
version = Gem::Version.new("1.2.3a")
p version.to_s # => "1.2.3a"
p version.version # => "1.2.3a"
//} -
Gem
:: Version # to _ s -> String (27646.0) -
バージョン情報を文字列として返します。
バージョン情報を文字列として返します。
//emlist[][ruby]{
version = Gem::Version.new("1.2.3a")
p version.to_s # => "1.2.3a"
p version.version # => "1.2.3a"
//} -
Gem
:: Version # <=>(other) -> -1 | 0 | 1 | nil (9751.0) -
self と other を比較して、self が小さい時に -1、 等しい時に 0、大きい時に 1 の整数を返します。 また、other が Gem::Version ではなく比較できないとき、 nil を返します。
...t[][ruby]{
p Gem::Version.new("3.9.0") <=> Gem::Version.new("3.10.0") # => -1
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0.0") # => 0
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0") # => 0
p Gem::Version.new("3.9.0") <=> "3.9.0" # => nil
//}
@param other 比較対象の G... -
Gem
:: Version # eql?(other) -> bool (9664.0) -
self と other の Gem::Version#version のバージョンが等しいとき true を返します。 そうでなければ false を返します。
self と other の Gem::Version#version のバージョンが等しいとき true を返します。
そうでなければ false を返します。
Comparable を include して作られた == と異なり、"1.0" と "1" は異なるものと判定します。
//emlist[][ruby]{
ver0 = Gem::Version.create('1.0') # #<Gem::Version "1.0">
ver1 = Gem::Version.create('1.0') # #<Gem::Version "1.0">
ver2 = Gem::Ver...