1件ヒット
[1-1件を表示]
(0.073秒)
ライブラリ
- ビルトイン (1)
検索結果
-
Method
# >>(callable) -> Proc (54379.0) -
self と引数を合成した Proc を返します。
...ます。
Method#<< とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
def f(x)
x * x
end
def g(x)
x + x
end
# (3 * 3) + (3 * 3)
p (method(:f) >> method(:g)).call(3......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#>>...