るりまサーチ

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

別のキーワード

  1. _builtin |
  2. ipaddr |
  3. set |
  4. array |
  5. trueclass |

ライブラリ

クラス

検索結果

<< 1 2 > >>

WIN32OLE_TYPE#variables -> [WIN32OLE_VARIABLE] (18120.0)

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

...きない場合に通知します。

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
xlDi...

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

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

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

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

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

WIN32OLE_VARIABLE#value -> object | nil (132.0)

変数の値を取得します。

...い場合はnilを返します。


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

実行結果は以下となります。

xlChart=-4109
xlDialog...

TracePoint#binding -> Binding | nil (120.0)

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

...は 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
//}...

絞り込み条件を変える

Object#instance_variable_get(var) -> object | nil (108.0)

オブジェクトのインスタンス変数の値を取得して返します。

...Foo
def initialize
@foo = 1
end
end

obj = Foo.new
p obj.instance_variable_get("@foo") #=> 1
p obj.instance_variable_get(:@foo) #=> 1
p obj.instance_variable_get(:@bar) #=> nil
//}

@see Object#instance_variable_set,Object#instance_variables,Object#instance_variable_defined?...

WIN32OLE_VARIABLE#name -> String (31.0)

変数名を取得します。

...変数名を取得します。

@return 変数名を文字列で返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables
= tobj.variables
variables
.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end...

WIN32OLE_VARIABLE#ole_type -> String (31.0)

変数の型を取得します。

...文字列
を返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables
= tobj.variables
variables
.each do |variable|
puts "#{variable.ole_type} #{variable.name}"
end

OLEオートメーションの型名は、対応するWIN32OLE::V...

WIN32OLE_VARIABLE#to_s -> String (31.0)

変数名を取得します。

...変数名を取得します。

@return 変数名を文字列で返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables
= tobj.variables
variables
.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end...

TracePoint#binding -> Binding (19.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
//}...

絞り込み条件を変える

<< 1 2 > >>