# File lib/parse_tree.rb, line 51 def self.translate(klass_or_str, method=nil) pt = self.new(false) case klass_or_str when String then sexp = pt.parse_tree_for_string(klass_or_str).first if method then # class, scope, block, *methods sexp.last.last[1..-1].find do |defn| defn[1] == method end else sexp end else unless method.nil? then if method.to_s =~ /^self\./ then method = method.to_s[5..-1].intern pt.parse_tree_for_method(klass_or_str, method, true) else pt.parse_tree_for_method(klass_or_str, method) end else pt.parse_tree(klass_or_str).first end end end