9件ヒット
[1-9件を表示]
(0.010秒)
検索結果
先頭5件
-
Module
# class _ variables -> [String] (7) -
クラス/モジュールに定義されているクラス変数の名前の配列を返します。
...定義されているクラス変数の名前の配列を返します。
スーパークラスやインクルードしているモジュールのクラス変数も含みます。
@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#constants... -
Module
# class _ variables -> [Symbol] (7) -
クラス/モジュールに定義されているクラス変数の名前の配列を返します。
...定義されているクラス変数の名前の配列を返します。
スーパークラスやインクルードしているモジュールのクラス変数も含みます。
@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#constants... -
Module
# constants -> [String] (7) -
そのモジュール(またはクラス)で定義されている定数名の配列を返します。 スーパークラスやインクルードしているモジュールの定数も含みます。
...。
@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#class_variables
Module.constants と Module#constants の違い
# 出力の簡略化のため起動時の定数一覧を取得して後で差し引く
$clist = Module.constants......p Module.constants - $clist # => ["BAR", "Bar", "Foo"]
class Baz
# Baz は定数を含まない
p constants - $clist # => []
# ネストしたクラスでは、外側のクラスで定義した定数は
# 参照可能なので、BAR は、Module.co......nstants には含まれる
# (クラス Baz も Bar の定数なので同様)
p Module.constants - $clist # => ["BAR", "Baz", "Bar", "Foo"]
end
end... -
Module
# constants(inherit = true) -> [Symbol] (7) -
そのモジュール(またはクラス)で定義されている定数名の配列を返します。
...ん。
@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#class_variables
Module.constants と Module#constants の違い
# 出力の簡略化のため起動時の定数一覧を取得して後で差し引く
$clist = Module.constants......p Module.constants - $clist # => [:BAR, :Bar, :Foo]
class Baz
# Baz は定数を含まない
p constants - $clist # => []
# ネストしたクラスでは、外側のクラスで定義した定数は
# 参照可能なので、BAR は、Module.con......stants には含まれる
# (クラス Baz も Bar の定数なので同様)
p Module.constants - $clist # => [:BAR, :Baz, :Foo, :Bar]
end
end... -
Module
. constants -> [String] (7) -
このメソッドを呼び出した時点で参照可能な定数名の配列を返します。
...ます。
class C
FOO = 1
end
p Module.constants # => ["RUBY_PLATFORM", "STDIN", ..., "C", ...]
# 出力中に "FOO" は現われない
@see Module#constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#class_variables... -
Module
. constants -> [Symbol] (7) -
このメソッドを呼び出した時点で参照可能な定数名の配列を返します。
...返します。
class C
FOO = 1
end
p Module.constants # => [:RUBY_PLATFORM, :STDIN, ..., :C, ...]
# 出力中に :FOO は現われない
@see Module#constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#class_variables...
