120件ヒット
[101-120件を表示]
(0.149秒)
ライブラリ
- ビルトイン (120)
クラス
- Module (48)
- Object (24)
- UnboundMethod (48)
キーワード
- arity (12)
-
define
_ method (24) - inspect (12)
-
public
_ instance _ method (12) -
public
_ method (12) -
singleton
_ method (12) -
source
_ location (12) -
to
_ s (12)
検索結果
-
Object
# singleton _ method(name) -> Method (6119.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
...はStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
class Demo
def initialize(n)
@iv = n
end
def hello()
"Hello, @iv = #{@iv}"
end
end
k = Demo.new(99)
def k.hi
"Hi, @iv = #{@iv}......"
end
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}
@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#method... -
UnboundMethod
# to _ s -> String (3227.0) -
self を読みやすい文字列として返します。
...self を読みやすい文字列として返します。
詳しくは Method#inspect を参照してください。
//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}
@see Method#inspect...