るりまサーチ

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

別のキーワード

  1. openssl g
  2. openssl g=
  3. dsa g
  4. dsa g=
  5. dh g

キーワード

検索結果

<< < ... 24 25 26 >>

OptionParser#on(short, long, *rest) {|v| ...} -> self (102.0)

オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。

...やハッシュに含まれない場合、例外
OptionParser::InvalidArgument が OptionParser#parse 実行時
に発生します。

@param short ショートオプションを表す文字列を指定します。

@param long ロングオプションを表す文字列を指定します。

@param...

OptionParser#on(short, long, desc = "") {|v| ... } -> self (102.0)

オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。

...せん
on("-xSTRING"){|val| ...} # スペース無しで任意の文字列を入れても同様
//}
オプションの引数が必須でない場合は [ ] をつけて、
//emlist{
on("-x [OPTIONAL]"){|val| ...}
//}
となります。

@param long ロングオプショ...
...list{
on("--long"){|boolean| ...} # オプションが引数をとらない場合。boolean には true が渡されます。
on("--long MANDATORY"){|val| ...} # オプションが引数をとる場合。" MANDATORY" の部分は任意の文字列で構いません
on("--long=MANDATORY"){|val...
...ます
# on("--longSTRING"){|val| ...} # ロングオプションでは、ショートオプションの場合と違って空白が必ず必要です。このようにすると --longSTRING という名前の引数をとらないオプションになります。
on("--long [OPTIONAL]"){|val| ......

OptionParser#on(short, long, pat = /.*/, desc = "") {|v| ...} -> self (102.0)

オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。

...lidArgument が parse 実行時に投げられます。

opts.on("--username VALUE", /[a-zA-Z0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --username=ruby.user #=> Error

@param short ショートオプションを表す文字列を指定します。

@param long...

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

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

...オブジェクト。

//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) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class
WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File...

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

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

...オブジェクト。

//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) # => 18
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class
WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File...

絞り込み条件を変える

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

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

...持ったオブジェクト。

//emlist[例][ruby]{
f = proc { |x| x * x }
g
= proc { |x| x + x }

# (3 + 3) * (3 + 3)
p (f << g).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class
WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write...

Proc#>>(callable) -> Proc (19.0)

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

...持ったオブジェクト。

//emlist[例][ruby]{
f = proc { |x| x * x }
g
= proc { |x| x + x }

# (3 * 3) + (3 * 3)
p (f >> g).call(3) # => 18
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class
WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write...
<< < ... 24 25 26 >>