Method: Method#with_class_and_method_name
- Defined in:
- lib/proc_to_ruby.rb
#with_class_and_method_name ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/proc_to_ruby.rb', line 8 def with_class_and_method_name if self.inspect =~ /<Method: (.*)\#(.*)>/ then klass = eval $1 method = $2.intern raise "Couldn't determine class from #{self.inspect}" if klass.nil? return yield(klass, method) else raise "Can't parse signature: #{self.inspect}" end end |