Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. import java.lang.reflect.Method;
  2. import java.lang.reflect.Type;
  3.  
  4.  
  5. class MethodExtension(o: AnyRef) {
  6.   def methods: List[String] = {
  7.     List.fromArray(o.getClass.getDeclaredMethods).map(m => m.getName)
  8.   }
  9. }
  10.  
  11. implicit def methods(o: AnyRef) = new MethodExtension(o)
  12.  
  13. println("".methods)