るりまサーチ

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

別のキーワード

  1. win32ole win32ole_variable
  2. win32ole_variable name
  3. win32ole_variable value
  4. win32ole_variable to_s
  5. win32ole variable_kind

ライブラリ

クラス

検索結果

<< 1 2 3 > >>

WIN32OLE_VARIABLE#name -> String (21120.0)

変数名を取得します。

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

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

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

NameError#name -> Symbol (21114.0)

この例外オブジェクトを発生させる原因となった 変数や定数、メソッドの名前をシンボルで返します。

...クトを発生させる原因となった
変数や定数、メソッドの名前をシンボルで返します。

例:

begin
foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.name # => :foobar
end...

NameError#local_variables -> [Symbol] (9101.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#remove_instance_variable(name) -> object (6255.0)

オブジェクトからインスタンス変数 name を取り除き、そのインス タンス変数に設定されていた値を返します。

...ンス変数 name を取り除き、そのインス
タンス変数に設定されていた値を返します。

@param name 削除するインスタンス変数の名前をシンボルか文字列で指定します。
@raise NameError オブジェクトがインスタンス変数 name を持たな...
...い場合に発生します。

//emlist[][ruby]{
class Foo
def foo
@foo = 1
p remove_instance_variable(:@foo) #=> 1
p remove_instance_variable(:@foo) # instance variable @foo not defined (NameError)
end
end
Foo.new.foo
//}

@see Module#remove_class_variable,Module#remove_const...

Module#class_variable_defined?(name) -> bool (6249.0)

name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。

...
name
で与えられた名前のクラス変数がモジュールに存在する場合 true を
返します。

@param name Symbol か String を指定します。

//emlist[例][ruby]{
class Fred
@@foo = 99
end
Fred.class_variable_defined?(:@@foo) #=> true
Fred.class_variable_defined?(:@@bar...
...) #=> false
Fred.class_variable_defined?('@@foo') #=> true
Fred.class_variable_defined?('@@bar') #=> false
//}...

絞り込み条件を変える

Module#class_variable_get(name) -> object (6237.0)

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

...るクラス変数 name の値を返します。

@param name String または Symbol を指定します。

@raise NameError クラス変数 name が定義されていない場合、発生します。

//emlist[例][ruby]{
class Fred
@@foo = 99
end

def Fred.foo
class_variable_get(:@@foo)
end...

Module#class_variable_set(name, val) -> object (6231.0)

クラス/モジュールにクラス変数 name を定義して、その値として val をセットします。val を返します。

...にクラス変数 name を定義して、その値として
val をセットします。val を返します。

@param name String または Symbol を指定します。

//emlist[例][ruby]{
class Fred
@@foo = 99
def foo
@@foo
end
end

def Fred.foo(val)
class_variable_set(:@@foo, val)...

Module#remove_class_variable(name) -> object (6227.0)

引数で指定したクラス変数を取り除き、そのクラス変数に設定さ れていた値を返します。

...クラス変数に設定さ
れていた値を返します。

@param name String または Symbol を指定します。

@return 引数で指定されたクラス変数に設定されていた値を返します。

@raise NameError 引数で指定されたクラス変数がそのモジュールや...
...クラスに定義されていない場合に発生します。

//emlist[例][ruby]{
class Foo
@@foo = 1
remove_class_variable(:@@foo) # => 1
p @@foo # => uninitialized class variable @@foo in Foo (NameError)
end
//}

@see Module#remove_const, Object#remove_instance_variable...

WIN32OLE_TYPE#variables -> [WIN32OLE_VARIABLE] (6226.0)

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

...がEnum(列挙型)やユーザ定義型の場合、メンバ変数の情報を
WIN32OLE_VARIABLEオブジェクトの配列として返します。

@return 型が持つ変数情報をWIN32OLE_VARIABLEの配列として返します。
変数を持たない場合は空配列を返しま...
...= tobj.variables
vars.each do |v|
puts "#{v.name} = #{v.value}"
end

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

xlChart = -4109
xlDialogSheet = -4116
xlExcel4IntlMacroSheet = 4
xlExcel4MacroSheet = 3
xlWorksheet = -4167

@see WIN32OLE_VARIABLE...
<< 1 2 3 > >>