るりまサーチ

最速Rubyリファレンスマニュアル検索!
183件ヒット [1-100件を表示] (0.129秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:arguments[x]

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

検索結果

<< 1 2 > >>

Gem::Commands::BuildCommand#arguments -> String (21201.0)

引数の説明を表す文字列を返します。

引数の説明を表す文字列を返します。

Rake::TaskArguments#with_defaults(defaults) -> Hash (9324.0)

パラメータにデフォルト値をセットします。

...am defaults デフォルト値として使用するキーと値を格納したハッシュを指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
arguments
= Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])...
...=> {:name1=>"value1", :name2=>"value2"}
arguments
.with_defaults({ default_key: "default_value"}) # => {:default_key=>"default_value", :name1=>"value1", :name2=>"value2"}
arguments
.to_hash # => {:default_key=>"default_value", :name1=>"value1", :name2=>"valu...

Rake::TaskArguments#lookup(name) -> object (9200.0)

与えられた名前に対応する値を返します。

与えられた名前に対応する値を返します。

@param name パラメータ名を指定します。

Gem::Command#defaults_str -> String (6206.0)

このメソッドはサブクラスで再定義されます。 コマンドのオプションで使用するデフォルト値を表示するために使用する文字列を返します。

...このメソッドはサブクラスで再定義されます。
コマンドのオプションで使用するデフォルト値を表示するために使用する文字列を返します。

@see Gem::Command#arguments...

Kernel.#lambda -> Proc (6206.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...るべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError (tried to create Proc object without a block)
が発生します。

ブロックを指定...
...block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
l
ambda(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:shoul...
...emlist[Proc.new は引数の数が違っていてもエラーにならない][ruby]{
b = Proc.new{|a,b,c|
p a,b,c
}
b.call(2, 4)
#=> 2
4
nil
//}

//emlist[lambda は引数の数が違うとエラーになる][ruby]{
b = lambda{|a,b,c|
p a,b,c
}
b.call(2, 4)
#=> wrong number of arguments...
...mlist[Proc.new は引数の数が違っていてもエラーにならない][ruby]{
b = Proc.new{|a,b,c|
p a,b,c
}
b.call(2, 4)
#=> 2
4
nil
//}

//emlist[lambda は引数の数が違うとエラーになる][ruby]{
b = lambda{|a,b,c|
p a,b,c
}
b.call(2, 4)
# => wrong number of arguments...

絞り込み条件を変える

Kernel.#lambda { ... } -> Proc (6206.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...るべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError (tried to create Proc object without a block)
が発生します。

ブロックを指定...
...block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
l
ambda(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:shoul...
...emlist[Proc.new は引数の数が違っていてもエラーにならない][ruby]{
b = Proc.new{|a,b,c|
p a,b,c
}
b.call(2, 4)
#=> 2
4
nil
//}

//emlist[lambda は引数の数が違うとエラーになる][ruby]{
b = lambda{|a,b,c|
p a,b,c
}
b.call(2, 4)
#=> wrong number of arguments...
...mlist[Proc.new は引数の数が違っていてもエラーにならない][ruby]{
b = Proc.new{|a,b,c|
p a,b,c
}
b.call(2, 4)
#=> 2
4
nil
//}

//emlist[lambda は引数の数が違うとエラーになる][ruby]{
b = lambda{|a,b,c|
p a,b,c
}
b.call(2, 4)
# => wrong number of arguments...
...また、lambda に & 引数を渡すのは推奨されません。& 引数ではなくてブロック記法で記述する必要があります。

& 引数を渡した lambda は Warning[:deprecated] = true のときに警告メッセージ
「warning: lambda without a literal block is deprecat...
...the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
l
ambda(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手...
...e the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
proc(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手...

Object#yield_self -> Enumerator (6206.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...self を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
"my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}

値をメソッドチェインのパイプラインに次々と渡すの...
...は良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerat...
...返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

Object#yield_self {|x| ... } -> object (6206.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...self を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
"my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}

値をメソッドチェインのパイプラインに次々と渡すの...
...は良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerat...
...返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

rubygems/commands/help_command (6012.0)

Gem コマンドに関するヘルプを提供するためのライブラリです。

...gem help ARGUMENT [options]
Common Options:
-h, --help このコマンドのヘルプを表示します
-V, --[no-]verbose 表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE...
...y 自体のデバッグオプションを有効にします
Arguments
:
commands gem コマンドのサブコマンドの一覧を表示します
examples gem コマンドの使用例を表示します
<command> 指定されたコマンドのヘルプを表示し...

rubygems/commands/lock_command (6012.0)

指定された特定のバージョンの Gem パッケージに依存する Gem を使用するために 必要な Kernel#gem メソッドの呼び出し方法を文字列で出力します。

...な Kernel#gem メソッドの呼び出し方法を文字列で出力します。

Usage: gem lock GEMNAME-VERSION [GEMNAME-VERSION ...] [options]
Options:
-s, --[no-]strict 依存関係を満たせない場合に失敗します
Common Options:
-h, --help...
...--config-file FILE 指定された設定ファイルを使用します
--backtrace バックトレースを表示します
--debug Ruby 自体のデバッグオプションを有効にします
Arguments
:
GEMNAME...
...mand line. It will specify exact
versions in the requirements list to ensure that the gems loaded will always
be consistent. A full recursive search of all effected gems will be
generated.

Example:

gemlock rails-1.0.0 > lockdown.rb

will pr...

絞り込み条件を変える

GetoptLong#set_options(*arguments) -> self (3307.0)

あなたのプログラムで、認識させたいオプションをセットします。 個々のオプションは、オプション名と引数のフラグからなる配列でな ければいけません。

...のオプション名が、オプションの正式名
になります。配列中の引数のフラグは、GetoptLong::NO_ARGUMENT,
GetoptLong::REQUIRE_ARGUMENT, GetoptLong::OPTIONAL_ARGUMENT
のいずれかでなくてはなりません。

オプションを設定できるのは、get, get_optio...
...ます。

@param arguments オプションを表す配列を指定します。

@raise ArgumentError 不正な引数が与えられるた場合、発生します。

parser.set_options(['-d', '--debug', GetoptLong::NO_ARGUMENT],
['--version', GetoptLong::NO_ARGUMENT],...
...['--help', GetoptLong::NO_ARGUMENT])

オプション名と引数のフラグの順番に決まりはないので、次のような
形式でも構いません。

parser.set_options([GetoptLong::NO_ARGUMENT, '-d', '--debug'],
[GetoptLong::NO_ARGUMENT,...

Module#ruby2_keywords(method_name, ...) -> nil (3216.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...hrough
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the final hash argument is marked with a special
flag such that...
...is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
other methods.

This should only be used fo...
...ethods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the module responds to...
<< 1 2 > >>