class Method

def to_ruby

def to_ruby
  Ruby2Ruby.new.process(self.to_sexp)
end

def to_sexp

def to_sexp
  with_class_and_method_name do |klass, method|
    ParseTree.new(false).parse_tree_for_method(klass, method)
  end
end

def with_class_and_method_name

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