syntax_tree_ext 0.7.0 → 0.7.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 +4 -0
- data/Gemfile.lock +1 -1
- data/lib/syntax_tree_ext/version.rb +1 -1
- data/lib/syntax_tree_ext.rb +4 -4
- 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: 76f93356ad00c2206f575f6aa8117de178eb2710a6534f8df11c10871f68a9b8
|
4
|
+
data.tar.gz: a846f03d2f62bf8928764a6423df58ded2b1f524cf677c886f069f9e835cc7e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e677f857fe5e663a92d2e2905535647ce0c4c6927da6a151a1ab88fd7c3265d465efba409cd4147c7c20486e7aedde93cb7bfa715c00f19d499708bfb5ae17e
|
7
|
+
data.tar.gz: f9b15130df4786bb1b9548ea3d21eb234508270c38599b80cf01600fa7cd8de8c6150283c6e1e13bb69975b5aea6ad0535410fc952d8013963921ec4926efd7b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/syntax_tree_ext.rb
CHANGED
@@ -51,7 +51,7 @@ module SyntaxTree
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def keys
|
54
|
-
if
|
54
|
+
if respond_to_assocs?
|
55
55
|
assocs.map(&:key)
|
56
56
|
else
|
57
57
|
raise MethodNotSupported, "keys is not supported for #{self}"
|
@@ -59,7 +59,7 @@ module SyntaxTree
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def values
|
62
|
-
if
|
62
|
+
if respond_to_assocs?
|
63
63
|
assocs.map(&:value)
|
64
64
|
else
|
65
65
|
raise MethodNotSupported, "values is not supported for #{self}"
|
@@ -67,7 +67,7 @@ module SyntaxTree
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def hash_assoc(key)
|
70
|
-
if
|
70
|
+
if respond_to_assocs?
|
71
71
|
assocs.find { |assoc_node| assoc_node.key.to_value == key }
|
72
72
|
else
|
73
73
|
raise MethodNotSupported, "hash_assoc is not supported for #{self}"
|
@@ -75,7 +75,7 @@ module SyntaxTree
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def hash_value(key)
|
78
|
-
if
|
78
|
+
if respond_to_assocs?
|
79
79
|
assocs.find { |assoc_node| assoc_node.key.to_value == key }&.value
|
80
80
|
else
|
81
81
|
raise MethodNotSupported, "hash_value is not supported for #{self}"
|
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.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: syntax_tree
|