るりまサーチ

最速Rubyリファレンスマニュアル検索!
431件ヒット [1-100件を表示] (0.126秒)
トップページ > クエリ:i[x] > クエリ:Variable[x] > 種類:インスタンスメソッド[x]

別のキーワード

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

検索結果

<< 1 2 3 ... > >>

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

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

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

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

Object#instance_variable_defined?(var) -> bool (18332.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_ge...
...t,Object#instance_variable_set,Object#instance_variables...

Binding#local_variable_defined?(symbol) -> bool (18232.0)

引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。

...//emlist[例][ruby]{
def foo
a = 1
binding.local_variable_defined?(:a) # => true
binding.local_variable_defined?(:b) # => false
end
//}

このメソッドは以下のコードの短縮形です。

//emlist[][ruby]{
binding.eval("defined?(#{symbol}) == 'local-variable'")
//}

@see Binding#lo...
...cal_variable_get, Binding#local_variable_set...

WIN32OLE_VARIABLE#variable_kind -> String (18214.0)

変数の種類(VARKIND)を取得します。

...類(VARKIND)を取得します。

この変数の種類を示す文字列を返します。

@return VARKINDに対応する文字列を返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
puts tobj.variables.map {|v| v.variable_kind}.uniq # => CO...
...以下のいずれかとなります。

: PERINSTANCE
インスタンス毎の変数。構造体やユーザ定義体のフィールド。(0)
: STATIC
クラスの静的変数。(1)
: CONSTANT
定数。enumやモジュールのメンバ。(2)
: DISPATCH
変数アクセスにオートメー...
...ションを利用。旧型式のプロパティ。(3)

@see WIN32OLE_VARIABLE#varkind...

Binding#local_variable_set(symbol, obj) (15250.0)

引数 symbol で指定した名前のローカル変数に引数 obj を設定します。

...//emlist[例][ruby]{
def foo
a = 1
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.lo...
...cal_variable_get(:b) # => 3
p a # => 2
p b # => NameError
end
//}

このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。

//emlist[][ruby]{
binding.eval("#{sy...
...mbol} = #{obj}")
//}

@see Binding#local_variable_get, Binding#local_variable_defined?...

絞り込み条件を変える

Binding#local_variable_get(symbol) -> object (15226.0)

引数 symbol で指定した名前のローカル変数に設定された値を返します。

...ol オブジェクトで指定します。

@raise NameError 引数 symbol で指定したローカル変数が未定義の場合に発生します。

//emlist[例][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?...

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

MonitorMixin::ConditionVariable#wait(timeout = nil) -> bool (15101.0)

モニタのロックを開放し、現在のスレッドを停止します。

...ックを保持している必要があります。

MonitorMixin::ConditionVariable#signal や
MonitorMixin::ConditionVariable#broadcast
で起こされるまでスレッドは停止し続けます。

timeout を与えた場合は最大 timeout 秒まで停止した後にスレッドを
再開し...
...によって危険領域(critical section)上で動作している
スレッドはただ一つになり、排他を実現します。

true を返します。timeout が与えられていて待ち時間が timeout を
越えた場合は false を返します。

@param timeout タイムアウトま...
...での秒数。指定しなかった場合はタイムアウトしません。

@raise ThreadError ロックを持っていないスレッドがこのメソッドを呼びだした場合に発生します

@see MonitorMixin::ConditionVariable#wait_while, MonitorMixin::ConditionVariable#wait_until...

MonitorMixin::ConditionVariable#wait_until { ... } -> () (15101.0)

モニタのロックを開放し、現在のスレッドを ブロックで指定した条件を満たすまで停止します。

...を開放し、現在のスレッドを
ブロックで指定した条件を満たすまで停止します。

MonitorMixin::ConditionVariable#signal や
MonitorMixin::ConditionVariable#broadcast で
スレッドが起こされると、ロックを取得し、ブロックを評価し
その結果に...
...よってこのメソッドから抜け処理を継続するか
再びロックを開放しスレッドを停止するかを決めます。

@see MonitorMixin::ConditionVariable#wait...

MonitorMixin::ConditionVariable#wait_while { ... } -> () (15101.0)

モニタのロックを開放し、現在のスレッドを ブロックで指定した条件を満たしている間停止します。

...放し、現在のスレッドを
ブロックで指定した条件を満たしている間停止します。

MonitorMixin::ConditionVariable#signal や
MonitorMixin::ConditionVariable#broadcast で
スレッドが起こされると、ロックを取得し、ブロックを評価し
その結果に...
...このメソッドから抜け処理を継続するか
再びロックを開放しスレッドを停止するかを決めます。

@raise ThreadError ロックを持っていないスレッドがこのメソッドを呼びだした場合に発生します
@see MonitorMixin::ConditionVariable#wait...

絞り込み条件を変える

<< 1 2 3 ... > >>