Ruby rt = self.getRuntime();
if(self.callMethod(context, "is_binary_data?").isTrue()) {
return RuntimeHelpers.invoke(context, arg, "scalar", rt.newString("tag:yaml.org,2002:binary"), rt.newArray(self).callMethod(context, "pack", rt.newString("m")), rt.newString("|"));
}
if(((List)self.callMethod(context, "to_yaml_properties")).isEmpty()) {
JRubyRepresenter rep = into(arg);
if(rep != null) {
try {
return JavaUtil.convertJavaToRuby(rt,rep.scalar(self.callMethod(context, "taguri").toString(),self.convertToString().getByteList(),self.toString().startsWith(":") ? "\"" : self.callMethod(context, "to_yaml_style").toString()));
} catch(IOException e) {
throw rt.newIOErrorFromException(e);
}
} else {
return RuntimeHelpers.invoke(context, arg, "scalar", self.callMethod(context, "taguri"), self, self.toString().startsWith(":") ? rt.newString("\"") : self.callMethod(context, "to_yaml_style"));