Comment detail

メソッド名一覧の表示 (Nested Flatten)
1
2
3
4
5
6
7
8
9
class Foo
  private;   def test_foo()   puts("test_foo_private") end
  public;   def test_foo2()   puts("test_foo_public") end
  protected; def test_fuga()  puts("test_fuga") end
  public;    def public_foo() puts("public_foo")   end
end

obj = Foo.new
["methods","private_methods"].collect{|m| obj.send(m).grep(/^test_/)}.flatten.each{|m| obj.instance_eval m}

Index

Feed

Other

Link

Pathtraq

loading...