るりまサーチ

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

別のキーワード

  1. _builtin []
  2. string []
  3. matrix []
  4. rake []
  5. symbol []

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

CGI::QueryExtension::Value#[](idx, *args) (21101.0)

@todo

@todo

Rake::TaskArguments#[](key) -> object (18125.0)

与えられたパラメータ名に対応する値を返します。

...の名前を指定します。

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

task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments["name1"] # => "value1"
arguments["name2"] # => "value2"
end
//}...

Thread#value -> object (18120.0)

スレッド self が終了するまで待ち(Thread#join と同じ)、 そのスレッドのブロックが返した値を返します。スレッド実行中に例外が 発生した場合には、その例外を再発生させます。

...結果を出力する例です。

threads = []
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })

threads.each {|t| p t.value}

最後の行で、待ち合わせを行って...
...いることがわかりにくいと思うなら以下
のように書くこともできます。

threads.each {|t| p t.join.value}...

JSON::State#[](name) -> object (18117.0)

Return the value returned by method name.

...Return the value returned by method name....

Hash#[](key) -> object | nil (18113.0)

key に関連づけられた値を返します。

..."all"}
p h[:ab] #=> "some"
p h[:ef] #=> nil

h1 = Hash.new("default value")
p h1[:non] #=> "default value"

h2 = Hash.new {|*arg| arg}
p h2[:non] #=> [{}, :non]
//}

@see Hash.new, Hash#fetch,Hash#values_at,Hash#key?, Hash#default, Hash#default_proc...

絞り込み条件を変える

Win32::Registry#[](name, wtype = nil) (18113.0)

@todo

...@todo

レジストリ値 name に value を書き込みます。

オプション引数 wtype を指定した場合は,その型で書き込みます。
指定しなかった場合,value のクラスに応じて次の型で書き込みます:
* Integer
REG_DWORD
* String
REG_SZ
*...

Rinda::TupleEntry#[](key) (18107.0)

タプルの key に対応する要素を返します。

...タプルの key に対応する要素を返します。

Rinda::TupleEntry#value[key] を返します。

@param key 要素を指定するキー

@see Rinda::TupleEntry#fetch...

Thread#[](name) -> object | nil (18107.0)

name に対応したスレッドに固有のデータを取り出します。 name に対応するスレッド固有データがなければ nil を返し ます。

...>: C
//}

Thread#[] と Thread#[]= を用いたスレッド固有の変数は
Fiber を切り替えると異なる変数を返す事に注意してください。

//emlist[][ruby]{
def meth(newvalue)
begin
oldvalue = Thread.current[:name]
Thread.current[:name] = newvalue
yield
ensu...
...re
Thread.current[:name] = oldvalue
end
end
//}

この関数に与えるブロックがFiberを切り替える場合は動的スコープとしては
正しく動作しません。

//emlist[][ruby]{
f = Fiber.new {
meth(1) {
Fiber.yield
}
}
meth(2) {
f.resume
}
f.resume
p Thread.cu...
...rrent[:name]
# => nil if fiber-local
# => 2 if thread-local (The value 2 is leaked to outside of meth method.)
//}

Fiber を切り替えても同じ変数を返したい場合は
Thread#thread_variable_get と Thread#thread_variable_set
を使用してください。

Thread#[]=...
...rrent[:name]
# => nil if fiber-local
# => 2 if thread-local (The value 2 is leaked to outside of meth method.)
//}

Fiber を切り替えても同じ変数を返したい場合は
Thread#thread_variable_get と Thread#thread_variable_set
を使用してください。

@see Thread#fetch, Thread#[]=...

Hash#[]=(key, value) (6253.0)

key に対して value を関連づけます。value を返し ます。

...key に対して value を関連づけます。value を返し
ます。

@param key キーを指定します。
@param value 値を指定します。


//emlist[例][ruby]{
h = {}

h[:key] = "value"
p h #=>{:key => "value"}
//}

@see Hash#[]...

DBM#[]=(key, value) (6240.0)

key をキーとして、value を格納します。 value として nil を指定すると、key に対する要素を削除します。

...key をキーとして、value を格納します。
value
として nil を指定すると、key に対する要素を削除します。

@param key キー。
@param value 値。...

絞り込み条件を変える

<< 1 2 3 ... > >>