るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

検索結果

<< 1 2 3 ... > >>

WIN32OLE_TYPE#variables -> [WIN32OLE_VARIABLE] (24307.0)

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

...メンバ変数の情報を
WIN32OLE_VARIABLEオブジェクトの配列として返します。

@return 型が持つ変数情報をWIN32OLE_VARIABLEの配列として返します。
変数を持たない場合は空配列を返します。
@raise WIN32OLERuntimeError 型属性が取得で...
...tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
vars = tobj.variables
vars.each do |v|
puts "#{v.name} = #{v.value}"
end

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

xlChart = -4109
xlDialogSheet = -4116
xlExcel4IntlMacro...
...Sheet = 4
xlExcel4MacroSheet = 3
xlWorksheet = -4167

@see WIN32OLE_VARIABLE...

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

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

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

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

TracePoint#binding -> Binding (15406.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...発生したイベントによって生成された Binding オブジェクトを返します。


//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}...

TracePoint#binding -> Binding | nil (15406.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...れた Binding オブジェクトを返します。

C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。

//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:...
...call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}...

Binding#local_variables -> [Symbol] (15213.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")
//}...

絞り込み条件を変える

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

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

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

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

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

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

プログラム中で定義されているグローバル変数(`$'で始まる変数)名の 配列を返します。

...グラム中で定義されているグローバル変数(`$'で始まる変数)名の
配列を返します。

//emlist[例][ruby]{
p global_variables #=> [:$;, :$-F, :$@, ... ]
//}

@see Kernel.#local_variables,Object#instance_variables,Module.constants,Module#constants,Module#class_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] (12207.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#instance_variable_defined?(var) -> bool (12206.0)

インスタンス変数 var が定義されていたら真を返します。

...//emlist[][ruby]{
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
p fred.instance_variable_defined?(:@a) #=> true
p fred.instance_variable_defined?("@b") #=> true
p fred.instance_variable_defined?("@c") #=> false
//}

@see Object#instance_variable_...
...get,Object#instance_variable_set,Object#instance_variables...
<< 1 2 3 ... > >>