parser_node_ext 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/lib/parser_node_ext/version.rb +1 -1
- data/lib/parser_node_ext.rb +11 -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: 9abeb78d465d5e90a8cd5d921d8cf4e18ccbab4b4cb55997fb49bea0255125a0
|
4
|
+
data.tar.gz: c084ba2e63f1575d8167aac4a970966a0ef0d7ce9b8da2e19dc5ce360d16ee27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d30a4c0ef68c37ab8232dbadacabc4d28099395bbebb3b54e3de6f2c0697de5fff91ba83ec81fc9ba14b98bd4226c59f1da1a1dff3349c39e2e5bc6bce5ca732
|
7
|
+
data.tar.gz: f6f7b429dafe2547a302efd8b58dbdb65cc8700de0b09b3373e30efb5042358db1ceabfde5334237d18c8ad630cf11f879862c9c55e212556bf33ce9461b5b0f
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/parser_node_ext.rb
CHANGED
@@ -130,6 +130,16 @@ module ParserNodeExt
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
+
def fullname
|
134
|
+
if %i[class module].include?(type)
|
135
|
+
if parent&.respond_to?(:fullname)
|
136
|
+
"#{parent.fullname}::#{name.to_source}"
|
137
|
+
else
|
138
|
+
name.to_source
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
133
143
|
# Get arguments of node.
|
134
144
|
# It supports :block, :csend, :def, :defined?, :defs, :send, :yeild nodes.
|
135
145
|
# @example
|
@@ -139,7 +149,7 @@ module ParserNodeExt
|
|
139
149
|
# @raise [MethodNotSupported] if calls on other node.
|
140
150
|
def arguments
|
141
151
|
case type
|
142
|
-
when :def
|
152
|
+
when :def
|
143
153
|
children[1].type == :args ? children[1].children : [children[1]]
|
144
154
|
when :defs
|
145
155
|
children[2].type == :args ? children[2].children : [children[2]]
|