507件ヒット
[101-200件を表示]
(0.027秒)
別のキーワード
クラス
- Binding (47)
-
JSON
:: Parser (12) - Module (72)
- Monitor (6)
-
MonitorMixin
:: ConditionVariable (60) - NameError (34)
- Object (72)
- Thread (48)
-
Thread
:: ConditionVariable (36) -
WIN32OLE
_ TYPE (12) -
WIN32OLE
_ VARIABLE (96)
モジュール
- MonitorMixin (12)
キーワード
- [] (12)
- broadcast (24)
-
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) -
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (21) - name (24)
-
new
_ cond (18) -
ole
_ type (12) -
ole
_ type _ detail (12) - parse (12)
-
pretty
_ print _ instance _ variables (12) -
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) - signal (24)
-
thread
_ variable? (12) -
thread
_ variable _ get (12) -
thread
_ variable _ set (12) -
to
_ s (24) - value (12)
-
variable
_ kind (12) - variables (12)
- varkind (12)
- visible? (12)
- wait (24)
-
wait
_ until (12) -
wait
_ while (12)
検索結果
先頭5件
-
Module
# class _ variable _ defined?(name) -> bool (6126.0) -
name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。
...name Symbol か String を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
end
Fred.class_variable_defined?(:@@foo) #=> true
Fred.class_variable_defined?(:@@bar) #=> false
Fred.class_variable_defined?('@@foo') #=> true
Fred.class_variable_defined?('@@bar') #=> false
//}... -
Object
# remove _ instance _ variable(name) -> object (6126.0) -
オブジェクトからインスタンス変数 name を取り除き、そのインス タンス変数に設定されていた値を返します。
...ない場合に発生します。
//emlist[][ruby]{
class Foo
def foo
@foo = 1
p remove_instance_variable(:@foo) #=> 1
p remove_instance_variable(:@foo) # instance variable @foo not defined (NameError)
end
end
Foo.new.foo
//}
@see Module#remove_class_variable,Module#remove_const... -
Thread
# thread _ variable?(key) -> bool (6126.0) -
引数 key で指定した名前のスレッドローカル変数が存在する場合に true、そ うでない場合に false を返します。
...thread_variable_set(:oliver, "a")
me.thread_variable?(:oliver) # => true
me.thread_variable?(:stanley) # => false
[注意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)が
対象ではない事に注意してください。
@see Thread#thread_variable_get, T... -
Thread
# thread _ variable _ get(key) -> object | nil (6126.0) -
引数 key で指定した名前のスレッドローカル変数を返します。
...例:
Thread.new {
Thread.current.thread_variable_set("foo", "bar") # スレッドローカル
Thread.current["foo"] = "bar" # Fiber ローカル
Fiber.new {
Fiber.yield [
Thread.current.thread_variable_get("foo"), # スレッドローカル......]
}.resume
}.join.value # => ['bar', nil]
この例の "bar" は Thread#thread_variable_get により得られ
た値で、nil はThread#[] により得られた値です。
@see Thread#thread_variable_set, Thread#[]
@see https://magazine.rubyist.net/articles/0041/0041-200Special-note.h... -
Module
# remove _ class _ variable(name) -> object (6120.0) -
引数で指定したクラス変数を取り除き、そのクラス変数に設定さ れていた値を返します。
...ールやクラスに定義されていない場合に発生します。
//emlist[例][ruby]{
class Foo
@@foo = 1
remove_class_variable(:@@foo) # => 1
p @@foo # => uninitialized class variable @@foo in Foo (NameError)
end
//}
@see Module#remove_const, Object#remove_instance_variable... -
Thread
# thread _ variable _ set(key , value) (6120.0) -
引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま す。
...。
//emlist[例][ruby]{
thr = Thread.new do
Thread.current.thread_variable_set(:cat, 'meow')
Thread.current.thread_variable_set("dog", 'woof')
end
thr.join # => #<Thread:0x401b3f10 dead>
thr.thread_variables # => [:dog, :cat]
//}
@see Thread#thread_variable_get, Thread#[]... -
Module
# class _ variable _ get(name) -> object (6108.0) -
クラス/モジュールに定義されているクラス変数 name の値を返します。
...の値を返します。
@param name String または Symbol を指定します。
@raise NameError クラス変数 name が定義されていない場合、発生します。
//emlist[例][ruby]{
class Fred
@@foo = 99
end
def Fred.foo
class_variable_get(:@@foo)
end
p Fred.foo #=> 99
//}... -
Module
# class _ variable _ set(name , val) -> object (6108.0) -
クラス/モジュールにクラス変数 name を定義して、その値として val をセットします。val を返します。
...をセットします。val を返します。
@param name String または Symbol を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
def foo
@@foo
end
end
def Fred.foo(val)
class_variable_set(:@@foo, val)
end
p Fred.foo(101) # => 101
p Fred.new.foo # => 101
//}... -
Object
# instance _ variables -> [Symbol] (6107.0) -
オブジェクトのインスタンス変数名をシンボルの配列として返します。
...列として返します。
//emlist[][ruby]{
obj = Object.new
obj.instance_eval { @foo, @bar = nil }
p obj.instance_variables
#=> [:@foo, :@bar]
//}
@see Object#instance_variable_get, Kernel.#local_variables, Kernel.#global_variables, Module.constants, Module#constants, Module#class_variables...
