るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file size
  4. file atime
  5. file truncate

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 >>

Proc#<<(callable) -> Proc (37.0)

self と引数を合成した Proc を返します。

...//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }

# (3 + 3) * (3 + 3)
p (f << g).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File
.write('testfile', <<~TEXT)
Hello,...
...World!
Hello, Ruby!
TEXT

pipeline = proc { |data| puts "word count: #{data.size}" } << WordScanner << File.method(:read)
pipeline.call('testfile') # => word count: 4
//}

@see Method#<<, Method#>>...
<< < 1 2 >>