mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add display_name convenience method
This commit is contained in:
parent
01d1a8736e
commit
f4fc599a1d
1 changed files with 6 additions and 1 deletions
|
@ -59,10 +59,15 @@ module Spectator
|
|||
Tags.new(metadata.keys)
|
||||
end
|
||||
|
||||
# Non-nil name used to show the node name.
|
||||
def display_name
|
||||
@name || "<anonymous>"
|
||||
end
|
||||
|
||||
# Constructs the full name or description of the node.
|
||||
# This prepends names of groups this node is part of.
|
||||
def to_s(io)
|
||||
(@name || "<anonymous>").to_s(io)
|
||||
display_name.to_s(io)
|
||||
end
|
||||
|
||||
# Exposes information about the node useful for debugging.
|
||||
|
|
Loading…
Reference in a new issue