464件ヒット
[1-100件を表示]
(0.112秒)
別のキーワード
クラス
- Binding (43)
-
JSON
:: Parser (11) - Module (66)
- Monitor (5)
-
MonitorMixin
:: ConditionVariable (55) - NameError (31)
- Object (66)
- Thread (44)
-
Thread
:: ConditionVariable (33) -
WIN32OLE
_ TYPE (11) -
WIN32OLE
_ VARIABLE (88)
モジュール
- MonitorMixin (11)
キーワード
- [] (11)
- broadcast (22)
-
class
_ variable _ defined? (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) -
class
_ variables (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variable _ set (11) -
instance
_ variables (11) -
local
_ variable _ defined? (11) -
local
_ variable _ get (11) -
local
_ variable _ set (11) -
local
_ variables (19) - name (22)
-
new
_ cond (16) -
ole
_ type (11) -
ole
_ type _ detail (11) - parse (11)
-
pretty
_ print _ instance _ variables (11) -
remove
_ class _ variable (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) - signal (22)
-
thread
_ variable? (11) -
thread
_ variable _ get (11) -
thread
_ variable _ set (11) -
to
_ s (22) - value (11)
-
variable
_ kind (11) - variables (11)
- varkind (11)
- visible? (11)
- wait (22)
-
wait
_ until (11) -
wait
_ while (11)
検索結果
先頭5件
-
WIN32OLE
_ VARIABLE # variable _ kind -> String (9114.0) -
変数の種類(VARKIND)を取得します。
...対応する文字列を返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
puts tobj.variables.map {|v| v.variable_kind}.uniq # => CONSTANT
返送値は以下のいずれかとなります。
: PERINSTANCE
インスタンス毎の変数。構造......体やユーザ定義体のフィールド。(0)
: STATIC
クラスの静的変数。(1)
: CONSTANT
定数。enumやモジュールのメンバ。(2)
: DISPATCH
変数アクセスにオートメーションを利用。旧型式のプロパティ。(3)
@see WIN32OLE_VARIABLE#varkind... -
WIN32OLE
_ TYPE # variables -> [WIN32OLE _ VARIABLE] (6220.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... -
Binding
# local _ variable _ set(symbol , obj) (6150.0) -
引数 symbol で指定した名前のローカル変数に引数 obj を設定します。
...bind = binding
bind.local_variable_set(:a, 2) # set existing local variable `a'
bind.local_variable_set(:b, 3) # create new local variable `b'
# `b' exists only in binding
p bind.local_variable_get(:a) # => 2
p bind.local_variable_get(:b) # => 3
p a......# => NameError
end
//}
このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。
//emlist[][ruby]{
binding.eval("#{symbol} = #{obj}")
//}
@see Binding#local_variable_get, Binding#local_variable_defined?... -
Binding
# local _ variable _ defined?(symbol) -> bool (6132.0) -
引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。
...g.local_variable_defined?(:a) # => true
binding.local_variable_defined?(:b) # => false
end
//}
このメソッドは以下のコードの短縮形です。
//emlist[][ruby]{
binding.eval("defined?(#{symbol}) == 'local-variable'")
//}
@see Binding#local_variable_get, Binding#local_variable_set... -
Object
# instance _ variable _ defined?(var) -> bool (6132.0) -
インスタンス変数 var が定義されていたら真を返します。
..., @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... -
Object
# instance _ variable _ get(var) -> object | nil (6132.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?... -
Object
# instance _ variable _ set(var , value) -> object (6132.0) -
オブジェクトのインスタンス変数 var に値 value を設定します。
...value を返します。
//emlist[][ruby]{
obj = Object.new
p obj.instance_variable_set("@foo", 1) #=> 1
p obj.instance_variable_set(:@foo, 2) #=> 2
p obj.instance_variable_get(:@foo) #=> 2
//}
@see Object#instance_variable_get,Object#instance_variables,Object#instance_variable_defined?... -
Binding
# local _ variable _ get(symbol) -> object (6126.0) -
引数 symbol で指定した名前のローカル変数に設定された値を返します。
...][ruby]{
def foo
a = 1
binding.local_variable_get(:a) # => 1
binding.local_variable_get(:b) # => NameError
end
//}
このメソッドは以下のコードの短縮形です。
//emlist[][ruby]{
binding.eval("#{symbol}")
//}
@see Binding#local_variable_set, Binding#local_variable_defined?... -
Module
# class _ variable _ defined?(name) -> bool (6126.0) -
name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。
...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
//}... -
Object
# remove _ instance _ variable(name) -> object (6126.0) -
オブジェクトからインスタンス変数 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...