るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.030秒)

別のキーワード

  1. module attr
  2. module public
  3. module protected
  4. module private
  5. module new

ライブラリ

クラス

検索結果

UnboundMethod#owner -> Class | Module (18236.0)

このメソッドが定義されている class か module を返します。

...このメソッドが定義されている class か module を返します。

//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//}...

Method#owner -> Class | Module (18230.0)

このメソッドが定義されている class か module を返します。

...定義されている class か module を返します。

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.owner # => Foo

m = Foo.new.method(:puts) # => #<Method: Foo(Kernel)#puts>
m.owner # => Kernel
//}...