るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.116秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:@[x] > クエリ:ruby[x] > クエリ:class[x] > クエリ:on[x] > クエリ:singleton_methods[x]

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. thread abort_on_exception
  5. thread abort_on_exception=

ライブラリ

クラス

検索結果

Object#singleton_methods(inherited_too = true) -> [Symbol] (24370.0)

そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。

...
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。

singleton_methods
(false) は、Object#methods(false) と同じです。

@
param inherited_too 継承した特異メソッドを含める場合は真を、...
...1][ruby]{
Parent = Class.new

class
<<Parent
private; def private_class_parent() end
protected; def protected_class_parent() end
public; def public_class_parent() end
end

Foo = Class.new(Parent)

class
<<Foo
private; def private_class_foo() end
protected; def protected_class_foo()...
...end
public; def public_class_foo() end
end

module Bar
private; def private_bar() end
protected; def protected_bar() end
public; def public_bar() end
end

obj = Foo.new
class
<<obj
include Bar
private; def private_self() end
protected; def protected_self() end
public...