mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move common inspect code up to Node
This commit is contained in:
parent
d292c01e74
commit
88b323bc27
2 changed files with 16 additions and 11 deletions
|
@ -160,17 +160,8 @@ module Spectator
|
|||
|
||||
# Exposes information about the example useful for debugging.
|
||||
def inspect(io)
|
||||
# Full example name.
|
||||
io << '"'
|
||||
to_s(io)
|
||||
io << '"'
|
||||
|
||||
# Add location if it's available.
|
||||
if (location = self.location)
|
||||
io << " @ "
|
||||
io << location
|
||||
end
|
||||
|
||||
super
|
||||
io << ' '
|
||||
io << result
|
||||
end
|
||||
|
||||
|
|
|
@ -51,5 +51,19 @@ module Spectator
|
|||
def to_s(io)
|
||||
(@name || "<anonymous>").to_s(io)
|
||||
end
|
||||
|
||||
# Exposes information about the node useful for debugging.
|
||||
def inspect(io)
|
||||
# Full node name.
|
||||
io << '"'
|
||||
to_s(io)
|
||||
io << '"'
|
||||
|
||||
# Add location if it's available.
|
||||
if (location = self.location)
|
||||
io << " @ "
|
||||
io << location
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue