るりまサーチ

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

別のキーワード

  1. _builtin to_c
  2. etc sc_2_c_dev
  3. etc sc_2_c_bind
  4. tracer display_c_call=
  5. tracer display_c_call?

検索結果

<< 1 2 3 ... > >>

WIN32OLE_TYPE#variables -> [WIN32OLE_VARIABLE] (18125.0)

型が持つ変数を取得します。

...Microsoft Excel 14.0 Object Library', 'XlSheetType')
vars = tobj.variables
vars.each do |v|
puts "#{v.name} = #{v.value}"
end

上記を実行すると以下の出力が得られます。

xlChart = -4109
xlDialogSheet = -4116
xlExcel4IntlMacroSheet = 4
xlExcel4Macr...

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

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

...y]{
c
lass One
@@var1 = 1
end
c
lass 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...

Binding#local_variables -> [Symbol] (12229.0)

ローカル変数の一覧を Symbol の配列で返します。

...カル変数の一覧を Symbol の配列で返します。

//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
binding.local_variables #=> [:a, :n]
end
end
//}

このメソッドは以下のコードと同様の動作をします。

//emlist[][ruby]{
binding.eval("local_variables")
//}...

Kernel.#local_variables -> [Symbol] (12225.0)

現在のスコープで定義されているローカル変数名の配列を返します。

...現在のスコープで定義されているローカル変数名の配列を返します。

//emlist[例][ruby]{
yuyu = 0
p local_variables #=> [:yuyu]
//}

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

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

絞り込み条件を変える

NameError#local_variables -> [Symbol] (12219.0)

self が発生した時に定義されていたローカル変数名の一覧を返します。

...発生した時に定義されていたローカル変数名の一覧を返します。

内部での使用に限ります。

例:

def foo
begin
b = "bar"
c
= 123
d
rescue NameError => err
p err.local_variables #=> [:b, :c, :err]
end
end

a = "buz"
foo...

Object#pretty_print_instance_variables -> [String | Symbol] (12201.0)

プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。 返されたインスタンス変数はプリティプリント時に表示されます。

プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。
返されたインスタンス変数はプリティプリント時に表示されます。

pp に表示したくないインスタンス変数がある場合にこのメソッドを再定義します。

VALUE rb_mod_class_variables(VALUE obj) (12200.0)

VALUE rb_obj_instance_variables(VALUE obj) (12200.0)

<< 1 2 3 ... > >>