Method code for $object_lib.format_object()

[Turn off line numbering]
  1: arg obj, chop;
  2: var len, line, out, c;
  3: 
  4: if (type(obj) == 'frob)
  5:     return ["Frob " + obj.namef('ref)];
  6: c = obj.created_on();
  7: out = ["Object:   " + obj.namef('xref), "Created:  " + (c ? ctime(c) : "(Before Time)"), "Quota:    " + obj.quota() + " bytes" + (obj.quota_exempt() ? " ** exempt **" : ""), "Perms:    " + obj.flags().prefix("+").join(), "Size:     " + obj.size().to_english() + " bytes (on disk)", "Manager:  " + .get_name(obj.manager(), 'namef, ['xref])];
  8: line = obj.writers('literal);
  9: if (line.length() != 1)
 10:     line = "Writers:  " + line.to_english("(none)");
 11: else
 12:     line = "Writer:   " + line[1].namef('xref);
 13: if (chop)
 14:     line = line.chop(chop);
 15: out += [line];
 16: line = obj.trusted('literal) || [];
 17: if (listlen(line)) {
 18:     line = "Trusts:   " + line.to_english("(none)");
 19:     if (chop)
 20:         line = line.chop(chop);
 21:     out += [line];
 22: }
 23: line = obj.parents();
 24: if (line.length() > 1)
 25:     line = "Parents:  " + line.mmap('namef, 'xref).to_english();
 26: else if (!line)
 27:     line = "Parents:  (none)";
 28: else
 29:     line = "Parent:   " + line[1].namef('xref);
 30: if (chop)
 31:     line = line.chop(chop);
 32: out += [line];
 33: if (obj.has_ancestor($located))
 34:     out += ["Location: " + .get_name(obj.location(), 'namef, ['xref])];
 35: if (obj.is($path) && obj.ways())
 36:     out += ["Paths:    " + obj.ways().mmap('join, " => ").join(", ")];
 37: return out;

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon