るりまサーチ

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

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. win32ole_param output?
  4. bodytypetext param
  5. win32ole_param input?

ライブラリ

検索結果

Module#constants(inherit = true) -> [Symbol] (18169.0)

そのモジュール(またはクラス)で定義されている定数名の配列を返します。

...ラスで定義されている
定数は含まれません。 Object.constants とすると Object クラスで定義された
定数の配列が得られます。

得られる定数の順序は保証されません。

@param inherit true を指定するとスーパークラスや include した...
...e Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#class_variables

//emlist[Module.constants Module#constants の違い][ruby]{
# 出力の簡略化のため起動時の定数一覧を取得して後で差し引く
$clist = Module.constants...
...s Bar
BAR = 1

# Bar は BAR を含む
p constants # => [:BAR]
# 出力に FOO は含まれない
p Module.constants - $clist # => [:BAR, :Bar, :Foo]
class Baz
# Baz は定数を含まない
p constants # => []

# ネス...

Module#class_variables(inherit = true) -> [Symbol] (20.0)

クラス/モジュールに定義されているクラス変数の名前の配列を返します。

...クラス/モジュールに定義されているクラス変数の名前の配列を返します。

@param inherit false を指定しない場合はスーパークラスやインクルードして
いるモジュールのクラス変数を含みます。

//emlist[例][ruby]{
class One...
...d
class Two < One
@@var2 = 2
end
One.class_variables # => [:@@var1]
Two.class_variables # => [:@@var2, :@@var1]
Two.class_variables(false) # => [:@@var2]
//}

@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#constants...