29件ヒット
[1-29件を表示]
(0.085秒)
ライブラリ
- ビルトイン (17)
-
shell
/ command-processor (12)
クラス
- Enumerator (11)
- Proc (6)
-
Shell
:: CommandProcessor (12)
検索結果
先頭4件
-
Proc
# <<(callable) -> Proc (21166.0) -
self と引数を合成した Proc を返します。
...成した Proc を返します。
戻り値の Proc は可変長の引数を受け取ります。
戻り値の Proc を呼び出すと、まず受け取った引数を callable に渡して呼び出し、
その戻り値を self に渡して呼び出した結果を返します。
Proc#>> とは呼......び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }
# (3 + 3) * (3 + 3)
p (f << g).call(3) # => 36
//}
//emlist[call を定義した......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#>>... -
Shell
:: CommandProcessor # size(file) -> Integer (21115.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
...FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#size FileTest.#size?... -
Enumerator
# size -> Integer | Float :: INFINITY | nil (18126.0) -
self の要素数を返します。
...。
Enumerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。
//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 94109400
loop.size # => Float::INFINITY
(... -
Shell
:: CommandProcessor # size?(file) -> Integer | nil (9115.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
...FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#size FileTest.#size?...