以下の内容はhttps://tbpgr.hatenablog.com/entry/20140930/1412080018より取得しました。


Ruby | Object | methods

概要

Object#methods(include_inherited = true) -> [Symbol]

詳細

オブジェクトから呼び出し可能なメソッドの配列を返却。
public, protected のメソッドが対象。

サンプルコード
class Hoge
  def public_hoge; end
  protected
  def protected_hoge; end
  private
  def private_hoge; end
end

print Hoge.new.methods.grep /hoge/

出力

$ ruby object_methods.rb
[:public_hoge, :protected_hoge]



以上の内容はhttps://tbpgr.hatenablog.com/entry/20140930/1412080018より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14