エンジニアのソフトウェア的愛情

または私は如何にして心配するのを止めてプログラムを・愛する・ようになったか

2016-04-24から1日間の記事一覧

特定のモジュールをインクルードしているクラスを抽出する

探せばもっとよい方法があるかもしれない。 module Hoge def hoge puts "I'm #{self.class}. I'm including Hoge." end end class Foo include Hoge end class Bar include Hoge end class Baz < Bar end ObjectSpace.each_object(Class).select {|klass| kl…