constree 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/constree/node.rb +9 -3
- data/lib/constree/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91bc646f95fa84573ef59c5c7ae36cba758a46481dcc1a33c42aecc190fd35f8
|
4
|
+
data.tar.gz: fc31388a1493bade700bba3144ab67cea1a484e89812b8cc8dfa0a63b7c5da01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2859b1ada05e4933b59b597f60f6c05283720544fe101b7aed7d9781dd0ee6f3bc891b217333706ae384b83e67a300e883529b242ce3d6c988f6b693023e2492
|
7
|
+
data.tar.gz: 2bcae5e18331f0a84084d5e90822e32c82a7f110a83a2152050e3d77a14da0d04843c6ba052dab6cc2b976f3d964cab540ec52605019f2bd75303bc6fd5cf609
|
data/lib/constree/node.rb
CHANGED
@@ -40,9 +40,7 @@ module Constree
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def type
|
43
|
-
|
44
|
-
return "(#{constant.class.to_s})" unless Class === constant
|
45
|
-
"< " + constant.ancestors[1..].map(&:to_s).join(" < ")
|
43
|
+
ref ? "→ #{ref.full_name}" : "(#{constant.class.to_s})"
|
46
44
|
end
|
47
45
|
|
48
46
|
def not_yet? seen
|
@@ -56,4 +54,12 @@ module Constree
|
|
56
54
|
end
|
57
55
|
|
58
56
|
end
|
57
|
+
|
58
|
+
class NodeWithAncestors < Node
|
59
|
+
def type
|
60
|
+
return "→ #{ref.full_name}" if ref
|
61
|
+
return "(#{constant.class.to_s})" unless Class === constant
|
62
|
+
"< " + constant.ancestors[1..].map(&:to_s).join(" < ")
|
63
|
+
end
|
64
|
+
end
|
59
65
|
end
|
data/lib/constree/version.rb
CHANGED