るりまサーチ (Ruby 3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.033秒)

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. inspect? irb::context#inspect_mode
  5. service drb::extserv#stop_service

クラス

検索結果

Object#tap {|x| ... } -> self (25.0)

self を引数としてブロックを評価し、self を返します。

self を引数としてブロックを評価し、self を返します。

メソッドチェインの途中で直ちに操作結果を表示するために
メソッドチェインに "入り込む" ことが、このメソッドの主目的です。

//emlist[][ruby]{
(1..10) .tap {|x| puts "original: #{x}" }
.to_a .tap {|x| puts "array: #{x}" }
.select {|x| x.even? } .tap {|x| puts "evens: #{x}" }
.map ...