Skip to content

Commit a95225f

Browse files
committed
Minor: add Relationship::toString().
1 parent b782209 commit a95225f

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

lib/Node._coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ module.exports = class Node extends PropertyContainer
2424
super db, data
2525

2626
#
27-
# Return a string representation of this node.
27+
# Return a human-readable string representation of this node,
28+
# suitable for development purposes (e.g. debugging).
2829
#
2930
# @return {String}
3031
#

lib/Relationship._coffee

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ module.exports = class Relationship extends PropertyContainer
5757

5858
### Methods: ###
5959

60+
#
61+
# Return a human-readable string representation of this relationship,
62+
# suitable for development purposes (e.g. debugging).
63+
#
64+
# @return {String}
65+
#
66+
toString: ->
67+
# this library has no notion of unsaved relationships,
68+
# so assume this relationship has an id:
69+
"relationship @#{@id} (#{@type})"
70+
6071
#
6172
# Persist or update this relationship in the database. "Returns" (via
6273
# callback) this same instance after the save.

0 commit comments

Comments
 (0)