jievro-ast 0.4.0 → 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/Gemfile.lock +1 -1
- data/lib/jievro/ast/node.rb +16 -2
- data/lib/jievro/ast/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca0d93bc074485e2ba45a4c1bb4c08f5eb1ee7af
|
4
|
+
data.tar.gz: df3dd857a330104d2d4fdff7513bfa33e25108d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 884d3b767545f81a4f20ee8aa57131fa5fc56d936e155075c81984e4fe02b67c442fd902cdfc6429657a2a86bb5f04a86c17848f530ef635e37c17467fe7885d
|
7
|
+
data.tar.gz: 39717a5271a2dcf3de6fc22163933c1897a77c6fe013a04d4715b5dfa7c739d2893760b4f38073a0cdec9965bd00d99f5a849fe9caf0f593b220ac8778065a42
|
data/Gemfile.lock
CHANGED
data/lib/jievro/ast/node.rb
CHANGED
@@ -47,8 +47,22 @@ module Jievro
|
|
47
47
|
@value
|
48
48
|
end
|
49
49
|
|
50
|
-
def
|
51
|
-
|
50
|
+
def serialize
|
51
|
+
return @value if type == TYPE_LITERAL
|
52
|
+
|
53
|
+
if type == TYPE_COLLECTION
|
54
|
+
serialized = []
|
55
|
+
else
|
56
|
+
serialized = {
|
57
|
+
__type: type
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
each_with_index do |v, k|
|
62
|
+
serialized[k] = v.serialize
|
63
|
+
end
|
64
|
+
|
65
|
+
serialized
|
52
66
|
end
|
53
67
|
|
54
68
|
def each
|
data/lib/jievro/ast/version.rb
CHANGED