るりまサーチ

最速Rubyリファレンスマニュアル検索!
8件ヒット [1-8件を表示] (0.091秒)
トップページ > クエリ:ruby[x] > 種類:インスタンスメソッド[x] > クエリ:-[x] > クエリ:@[x] > クエリ:select[x] > クラス:Object[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

検索結果

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

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 {|x| x*x } .tap {|x| puts "squares: #{x}" }
//}

@
see Object#yield_self...