るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. rexml tag_end

ライブラリ

キーワード

検索結果

<< < 1 2 >>

OptionParser#on_head(*arg, &block) -> self (13.0)

オプションを取り扱うためのブロックを自身の持つリストの最初に登録します。

...][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end


puts opts.help

# => Usage: test [options]
# -i, --init
# -u, --update
# -h, --help
//}

@see OptionParser#on, OptionParser#on_tail...

OptionParser#to_a -> [String] (13.0)

サマリの各行を要素とした配列を返します。

...を返します。

//emlist[例][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end


opts.to_a # => ["Usage: test [options]", " -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}...
<< < 1 2 >>