るりまサーチ

最速Rubyリファレンスマニュアル検索!
13件ヒット [1-13件を表示] (0.020秒)
トップページ > 種類:文書[x] > クエリ:Comparable#clamp[x]

別のキーワード

  1. _builtin comparable
  2. comparable clamp
  3. comparable ==
  4. comparable >=
  5. comparable >

キーワード

検索結果

NEWS for Ruby 2.7.0 (79.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...実験的に導入されました。
caseやComparable#clampや定数やDSLなどで便利かもしれません。
14799

//emlist[][ruby]{
ary[..3] # identical to ary[0..3]

case RUBY_VERSION
when ..."2.4" then puts "EOL"
# ...
end

age.clamp(..100)

where(sales: ..100)
//}

* 「$;」...
...* Comparable
* 変更されたメソッド
* Comparable#clampがRangeを引数として受け付けるようになりました。 14784

//emlist[][ruby]{
-1.clamp(0..2) #=> 0
1.clamp(0..2) #=> 1
3.clamp(0..2) #=> 2
# With beginless and endless ranges:
-1.clamp(0..) #=> 0
3.clamp(.....

NEWS for Ruby 2.4.0 (25.0)

NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...るようになりました。
* Array#sum 12217
Enumerable#sum と違って each メソッドに依存しません。

* Comparable
* Comparable#clamp を追加 10594

* Dir
* Dir.empty? を追加 10121

* Enumerable
* Enumerable#chunk ブロックを省略した場合 E...