@JRubyClass(name="Exception")
public static class YAMLExceptionMethods {
@JRubyMethod(name = "to_yaml_node", required = 1)
public static IRubyObject exception_to_yaml_node(IRubyObject self, IRubyObject arg) {
ThreadContext context = self.getRuntime().getCurrentContext();
Map mep = (Map)(new RubyHash(self.getRuntime()));
mep.put(self.getRuntime().newString("message"),self.callMethod(context, "message"));
for(Iterator iter = ((RubyArray)self.callMethod(context, "to_yaml_properties")).getList().iterator(); iter.hasNext();) {
String m = iter.next().toString();
mep.put(self.getRuntime().newString(m.substring(1)), self.callMethod(context,"instance_variable_get", self.getRuntime().newString(m)));