るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

検索結果

<< 1 2 3 > >>

UnboundMethod#bind(obj) -> Method (18267.0)

self を obj にバインドした Method オブジェクトを生成して返します。

...タンスのみです。

@raise TypeError objがbindできないオブジェクトである場合に発生します

//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class Foo
def foo
"foo"
end

end


# UnboundMethod `m' を生成
p m = Foo.instance...
...スをレシーバとする Method オブジェクトを生成
p m.bind(Foo.new) # => #<Method: Foo#foo>

# Foo のサブクラス Bar のインスタンスをレシーバとする Method
class Bar < Foo
end

p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>


# モジュー...
...foo
"foo"
end

end


# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # => #<UnboundMethod: Foo#foo>

# Foo をインクルードしたクラス Bar のインスタンスをレシーバと
# する Method オブジェクトを生成
class Bar
include Foo
end

p m.bind(Bar.new)...

Fiddle::Importer#bind(signature, *opts) { ... } -> Fiddle::Function (18231.0)

Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。

...m opts オプション


require 'fiddle/import'

module M
extend Fiddle::Importer
dlload "libc.so.6"
typealias "size_t", "unsigned long"
extern "int qsort(void*, size_t, size_t, void*)"

bind
("int compare(void*, void*)"){|px, py|
x = px.to_s(Fiddle::SIZEOF_INT...
...).unpack("i!")
y = py.to_s(Fiddle::SIZEOF_INT).unpack("i!")

x <=> y
}
end


data = [32, 180001, -13, -1, 0, 49].pack("i!*")
M.qsort(Fiddle::Pointer[data], 6, Fiddle::SIZEOF_INT, M["compare"])
p data.unpack("i!*") # => [-13, -1, 0, 32, 49, 180001]...

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

TracePoint#binding -> Binding | nil (6312.0)

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

...生成された Binding オブジェクトを返します。

C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。

//emlist[例][ruby]{
def foo(ret)
ret
end

trace = TracePo...
...int.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end

trace.enable
foo 1
//}...

Kernel.#binding -> Binding (6306.0)

変数・メソッドなどの環境情報を含んだ Binding オブジェクトを 生成して返します。通常、Kernel.#eval の第二引数として使います。

...変数・メソッドなどの環境情報を含んだ Binding オブジェクトを
生成して返します。通常、Kernel.#eval の第二引数として使います。

//emlist[例][ruby]{
def foo
a = 1
bind
ing
end


eval("p a", foo) #=> 1
//}

@see Kernel.#eval,Object::TOPLEVEL_BINDING...

絞り込み条件を変える

Proc#binding -> Binding (6306.0)

Proc オブジェクトが保持するコンテキストを Binding オブジェクトで返します。

...Proc オブジェクトが保持するコンテキストを
Bind
ing オブジェクトで返します。

//emlist[例][ruby]{
def fred(param)
proc {}
end


sample_proc = fred(99)
eval("param", sample_proc.binding) # => 99
//}...

Method#unbind -> UnboundMethod (6218.0)

self のレシーバとの関連を取り除いた UnboundMethod オブ ジェクトを生成して返します。

...いた UnboundMethod オブ
ジェクトを生成して返します。

//emlist[例][ruby]{
class Foo
def foo
"foo"
end

end


m = Foo.new.method(:foo) # => #<Method: Foo#foo>
unbound_method = m.unbind # => #<UnboundMethod: Foo#foo>
unbound_method.bind(Foo.new) # => #<Method: Foo#foo>
//}...

ruby 1.6 feature (5574.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...グ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) -> stable-snapshot

: 2003-01-22: errno

EAGAIN と EWOULDBLOCK が同じ値の...
...02-07-30) [i586-linux]

: 2002-05-20 IO#close

双方向のパイプの dup を close_write するとエラーになっていました。
((<ruby-dev:17155>))

open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end

}

=> ruby 1.6.7 (2002-03-01...
...entation fault

=> ruby 1.6.5 (2001-10-15) [i586-linux]
MatchData
NotImplementedError
FloatDomainError
LoadError
Float
Bind
ing
SignalException
Module
-
:6:in `method_missing': stack level too de...

1.6.8から1.8.0への変更点(まとめ) (3390.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...作はなくなりました)

$defout や $deferr に代入を行うと警告がでます。
(注:1.6 に $deferr はありません)
((<ruby-dev:20961>))

$stdin にオブジェクトを代入すると標準入力からの入力メソッド(gets 等)
はそのオブジェクトにメソ...
...と定義されました
((<ruby-bugs-ja:313>))。なんだかよくわかりません(^^;

class << Object
p [self.id, self]
class << self
p [self.id, self]
end

end

=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Cla...
...ように
なりました。((<ruby-dev:20964>))

: ((<UnboundMethod>)) [compat]

UnboundMethod クラスは Method クラスのサブクラスではなくなりました。
UnboundMethod#call, UnboundMethod#unbind はなくなりました。
((<ruby-core:00927>))


: ((<NameError>)) & ((<No...

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

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

...a = 1
bind
ing.local_variable_defined?(:a) # => true
bind
ing.local_variable_defined?(:b) # => false
end

//}

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

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

@see Binding#local_variable_get, Binding#loc...

絞り込み条件を変える

Binding#local_variables -> [Symbol] (3112.0)

ローカル変数の一覧を Symbol の配列で返します。

...カル変数の一覧を Symbol の配列で返します。

//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
bind
ing.local_variables #=> [:a, :n]
end

end

//}

このメソッドは以下のコードと同様の動作をします。

//emlist[][ruby]{
bind
ing.eval("local_variables")
//}...
<< 1 2 3 > >>