96件ヒット
[1-96件を表示]
(0.113秒)
クラス
- Fiber (12)
- OptionParser (72)
- String (12)
キーワード
- resume (12)
- summarize (24)
-
summary
_ indent (12) -
summary
_ indent= (12) -
summary
_ width (12) -
summary
_ width= (12)
検索結果
先頭5件
- String
# sum(bits = 16) -> Integer - OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () - OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () - Fiber
# resume(*arg = nil) -> object - OptionParser
# summary _ indent -> String
-
String
# sum(bits = 16) -> Integer (18174.0) -
文字列の bits ビットのチェックサムを計算します。
...]{
def sum(bits)
sum = 0
each_byte {|c| sum += c }
return 0 if sum == 0
sum & ((1 << bits) - 1)
end
//}
例えば以下のコードで UNIX System V の
sum(1) コマンドと同じ値が得られます。
//emlist[例][ruby]{
sum = 0
ARGF.each_line do |line|
sum += line.sum
end
sum %= 6... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () (6307.0) -
サマリを指定された to へと加えていきます。
...ew do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, " ")
# => ["description\n", " -i\n", " --init\n", " -u\n", "... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (6307.0) -
サマリを指定された to へと加えていきます。
...ew do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, " ")
# => ["description\n", " -i\n", " --init\n", " -u\n", "... -
Fiber
# resume(*arg = nil) -> object (6107.0) -
自身が表すファイバーへコンテキストを切り替えます。 自身は resume を呼んだファイバーの子となります。
...自身が表すファイバーへコンテキストを切り替えます。
自身は resume を呼んだファイバーの子となります。
ただし、Fiber#transfer を呼び出した後に resume を呼び出す事はでき
ません。
@param arg self が表すファイバーに渡した......が表すスレッド間をまたがる場合、自身が resume を
呼んだファイバーの親かその祖先である場合に発生します。
また、Fiber#transfer を呼び出した後に resume を
呼び出した場合に発生し......ます。
//emlist[例:][ruby]{
f = Fiber.new do
Fiber.yield(:hoge)
:fuga
end
p f.resume() #=> :hoge
p f.resume() #=> :fuga
p f.resume() #=> FiberError: dead fiber called
//}... -
OptionParser
# summary _ indent -> String (6107.0) -
サマリを表示する時のインデントを文字列で返します。
...("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_indent = " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n"... -
OptionParser
# summary _ indent=(indent) (6107.0) -
サマリを表示する時のインデントを文字列で指定します。
..., "--update")
opts.on_tail("-h", "--help")
end
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_indent = " " # => " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --upd... -
OptionParser
# summary _ width -> Integer (6107.0) -
サマリを表示するときの幅を整数で返します。
...)
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_width = 8
opts.summary_width # =>8
opts.summarize
# => [" -i\n", " --init\n", " -u\n", "... -
OptionParser
# summary _ width=(width) (6107.0) -
サマリを表示するときの幅を整数で指定します。
...opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_width = 8 # => 8
opts.summary_width # => 8
opts.summarize
# => [" -i\n", " --init\n", " -u\n",...