ライブラリ
- ビルトイン (3)
検索結果
-
Object
# tap {|x| . . . } -> self (18126) -
self を引数としてブロックを評価し、self を返します。
...的です。
(1..10) .tap {|x| puts "original: #{x.inspect}"}.
to_a .tap {|x| puts "array: #{x.inspect}"}.
select {|x| x % 2 == 0} .tap {|x| puts "evens: #{x.inspect}"}.
map { |x| x * x } .tap {|x| puts "squares: #{x.inspect}"}...
