るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.113秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:Module#class_variables[x]

別のキーワード

  1. add rexml::attribute#name
  2. << rexml::attribute#name
  3. handle_interrupt thread#raise
  4. oid openssl::x509::extension#oid=
  5. oid= openssl::x509::extension#oid

ライブラリ

クラス

キーワード

検索結果

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

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

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

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

//emlist[例][ruby]{
class One
@@var1 = 1
end
class Two < One
@@var2 = 2
end
One.class_variables # => [:@@var1]
Two.class_variables # => [:@@var2, :@@var1]
Two.class_va...

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

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

...場合 対象にはなりません。

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

//emlist[Module.constants と Module#constants の違い][ruby]{
# 出力の簡略化のため起動時の定数一覧を取得して後...

Object#instance_variables -> [Symbol] (7.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...