mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move symolic logic to separate method
This commit is contained in:
parent
0b2ea79329
commit
bf17bc95ac
1 changed files with 10 additions and 3 deletions
|
@ -71,13 +71,20 @@ module Spectator
|
||||||
# Add padding between the node names
|
# Add padding between the node names
|
||||||
# only if the names don't appear to be symbolic.
|
# only if the names don't appear to be symbolic.
|
||||||
# Skip blank group names (like the root group).
|
# Skip blank group names (like the root group).
|
||||||
io << ' ' unless !group.name? || # ameba:disable Style/NegatedConditionsInUnless
|
io << ' ' unless symbolic_name?(group, name)
|
||||||
(group.name?.is_a?(Symbol) && name.is_a?(String) &&
|
|
||||||
(name.starts_with?('#') || name.starts_with?('.')))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
name.to_s(io)
|
name.to_s(io)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Checks if the full name and description of the node is symbolic.
|
||||||
|
# This means that a type or method name was referenced.
|
||||||
|
# Slightly different formatting is applied for symbolic node names.
|
||||||
|
private def symbolic_name?(group, name)
|
||||||
|
!group.name? ||
|
||||||
|
(group.name?.is_a?(Symbol) && name.is_a?(String) &&
|
||||||
|
(name.starts_with?('#') || name.starts_with?('.')))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue