るりまサーチ

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

別のキーワード

  1. open3 pipeline_r
  2. open3 pipeline_w
  3. open3 pipeline_rw
  4. open3 pipeline_start
  5. open3 pipeline

ライブラリ

クラス

キーワード

検索結果

Method#<<(callable) -> Proc (13.0)

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

...uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

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

pipeline
= method(:pp) << WordScanner << File.method(:read)
pipeline
.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Proc#<<, Proc#>>...

Method#>>(callable) -> Proc (13.0)

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

...uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

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

pipeline
= File.method(:read) >> WordScanner >> method(:pp)
pipeline
.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Proc#<<, Proc#>>...

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

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

...anner
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#>>...

Proc#>>(callable) -> Proc (13.0)

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

...anner
def self.call(str)
str.scan(/\w+/)
end
end

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

pipeline
= proc { |fname| File.read(fname) } >> WordScanner >> method(:p)
pipeline
.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

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