syntax_tree_ext 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/syntax_tree_ext/version.rb +1 -1
- data/lib/syntax_tree_ext.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9580df1305b4def597a9e270f05b42f5f8bc5704f433c4a0e5356591f0de7e5
|
4
|
+
data.tar.gz: b0264ef9b6a63c83918ef57dc38062da7fcf09e688fc756be3f21c15b4e64501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22f20003979d6dd4ed263098327362f932944e59b5278b7c68ed7261a2465dfbfd14fd617ab04c474358564de0ba44ebc4ce11475dad84fe673842afb679de26
|
7
|
+
data.tar.gz: e36f96c71b3359547c1bac1e15e8bcfa4ce724ac82d6f0a8b8750208e546af9bb7bf92a3b38459c40195299429bfebaf8040eddda1fe17b5cb1dcf7a23939553
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/syntax_tree_ext.rb
CHANGED
@@ -38,6 +38,22 @@ module SyntaxTree
|
|
38
38
|
parent_node.child_nodes[index + 1...]
|
39
39
|
end
|
40
40
|
|
41
|
+
def keys
|
42
|
+
if is_a?(BareAssocHash) || is_a?(HashLiteral)
|
43
|
+
assocs.map(&:key)
|
44
|
+
else
|
45
|
+
raise MethodNotSupported, "keys is not supported for #{self}"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def values
|
50
|
+
if is_a?(BareAssocHash) || is_a?(HashLiteral)
|
51
|
+
assocs.map(&:value)
|
52
|
+
else
|
53
|
+
raise MethodNotSupported, "values is not supported for #{self}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
41
57
|
def to_value
|
42
58
|
case self
|
43
59
|
when SymbolLiteral
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntax_tree_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: syntax_tree
|