Ruby/Reflection/find all
Материал из Wiki.crossplatform.ru
Версия от 17:57, 13 сентября 2010; ViGOur (Обсуждение | вклад)
Find all instance methods of Fixnum that take 2 arguments.
sample = 0 sample.class.find_all { |method_name| sample.method(method_name).arity == 2 } # => ["instance_variable_set", "between?"]