るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.021秒)
トップページ > クエリ:false[x] > クエリ:class_variables[x]

別のキーワード

  1. argf.class each_line
  2. argf.class each
  3. argf.class lines
  4. argf.class readlines
  5. argf.class readline

ライブラリ

クラス

検索結果

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

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

...erit 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_variables(false) # => [:@@var2]
//}

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

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

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

...定義された定数が対象にはなります。false を指定した場合 対象にはなりません。

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

//emlist[Module.constants と Module#constants の違い...