321件ヒット
[301-321件を表示]
(0.098秒)
別のキーワード
ライブラリ
- ビルトイン (246)
- pathname (51)
- rake (12)
-
rubygems
/ version (12)
クラス
-
Gem
:: Version (12) - Method (24)
- Module (132)
- Object (24)
- Pathname (51)
-
Rake
:: FileList (12) - Range (14)
- Refinement (4)
- TracePoint (12)
- UnboundMethod (12)
モジュール
- Enumerable (24)
キーワード
- < (12)
- <= (12)
- <=> (12)
- > (12)
- >= (12)
-
append
_ features (12) - bind (12)
- cover? (14)
-
defined
_ class (12) -
each
_ child (24) -
each
_ entry (39) - entries (12)
- eql? (12)
- extend (12)
-
import
_ methods (4) - include? (12)
- included (12)
-
included
_ modules (12) - inspect (12)
-
prepend
_ features (12) - resolve (12)
-
singleton
_ methods (12) -
to
_ s (12)
検索結果
-
UnboundMethod
# bind(obj) -> Method (135.0) -
self を obj にバインドした Method オブジェクトを生成して返します。
...
self を obj にバインドした Method オブジェクトを生成して返します。
@param obj 自身をバインドしたいオブジェクトを指定します。ただしバインドできるのは、
生成元のクラスかそのサブクラスのインスタンスのみで......す。
@raise TypeError objがbindできないオブジェクトである場合に発生します
//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class Foo
def foo
"foo"
end
end
# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # =>......を生成
p m = Foo.instance_method(:foo) # => #<UnboundMethod: Foo#foo>
# Foo をインクルードしたクラス Bar のインスタンスをレシーバと
# する Method オブジェクトを生成
class Bar
include Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>
//}......_method(:foo) # => #<UnboundMethod: Foo#foo>
# Foo をインクルードしたクラス Bar のインスタンスをレシーバと
# する Method オブジェクトを生成
class Bar
include Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>
//}
@see UnboundMethod#bind_call... -
Enumerable
# each _ entry -> Enumerator (120.0) -
ブロックを各要素に一度ずつ適用します。
...場合はブロックには配列として渡されます。
//emlist[例][ruby]{
class Foo
include Enumerable
def each
yield 1
yield 1,2
end
end
Foo.new.each_entry{|o| print o, " -- "}
# => 1 -- [1, 2] --
//}
ブロックを省略した場合は Enumerator が返されます。
@se...