るりまサーチ

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

別のキーワード

  1. _builtin local_variables
  2. pp pretty_print_instance_variables
  3. win32ole variables
  4. kernel local_variables
  5. module class_variables

検索結果

<< 1 2 3 ... > >>

WIN32OLE_TYPE#variables -> [WIN32OLE_VARIABLE] (18125.0)

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

...
WIN32OLE_VARIABLEオブジェクトの配列として返します。

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

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

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

@
see WIN32OLE_VA...

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

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

...す。

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

//emlist[例][ruby]{
class One
@
@var1 = 1
end
class 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...

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

Kernel.#global_variables -> [Symbol] (6131.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] (6131.0)

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

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

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

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

絞り込み条件を変える

変数と定数 (3006.0)

変数と定数 * local * instance * class * class_var_scope * global * pseudo * const * prio

...言は有効
p defined?(v) # => "local-variable"
p v # => nil
//}


===[a:instance] インスタンス変数

//emlist[例][ruby]{
@
foobar
//}

`@'で始まる変数はインスタンス変数であり、特定の
オブジェクトに所属しています。インスタンス変数は...
...ンスタンス変数を参照した時の値はnilです。


===[a:class] クラス変数

//emlist[例][ruby]{
class Foo
@
@foo = 1
def bar
puts @@foo
end
end
//}

@
@で始まる変数はクラス変数です。クラス変数はクラス定義
の中で定義され、クラスの特異...
...れる
グローバル変数であるとみなすことができます。

//emlist[][ruby]{
class Foo
@
@foo = 1
end

class Bar < Foo
p @@foo += 1 # => 2
end

class Baz < Bar
p @@foo += 1 # => 3
end
//}

モジュールで定義されたクラス変数(モジュール変数)...

REXML::XPath.each(element, path = nil, namespaces = {}, variables = {}) {|e| ... } -> () (131.0)

element の path で指定した XPath 文字列にマッチする各ノード に対してブロックを呼び出します。

...けるため、適切な
エスケープを付加するため、に用います。

@
param element 要素(REXML::Element)
@
param path XPath文字列
@
param namespace 名前空間とURLの対応付け
@
param variables 変数名とその値の対応付け

//emlist[][ruby]{
require 'rexml/document'
do...

REXML::XPath.first(element, path = nil, namespaces = {}, variables = {}) -> Node | nil (131.0)

element の path で指定した XPath 文字列にマッチする最初のノードを 返します。

...います。

マッチするノードがない場合には nil を返します。

@
param element 要素(REXML::Element)
@
param path XPath文字列
@
param namespace 名前空間とURLの対応付け
@
param variables 変数名とその値の対応付け

//emlist[][ruby]{
require 'rexml/document'
do...

REXML::XPath.match(element, path = nil, namespaces = {}, variables = {}) -> [Node] (131.0)

element の path で指定した XPath 文字列にマッチするノードの配列を 返します。

...けるため、適切な
エスケープを付加するため、に用います。

@
param element 要素(REXML::Element)
@
param path XPath文字列
@
param namespace 名前空間とURLの対応付け
@
param variables 変数名とその値の対応付け

//emlist[][ruby]{
require 'rexml/document'
do...
<< 1 2 3 ... > >>