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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6e64d89ba57a3d0007d7ad0d3ea7cb47b610e5c
4
- data.tar.gz: 856bac677482c222ff6e658cb62bb753fc246810
3
+ metadata.gz: ca0d93bc074485e2ba45a4c1bb4c08f5eb1ee7af
4
+ data.tar.gz: df3dd857a330104d2d4fdff7513bfa33e25108d2
5
5
  SHA512:
6
- metadata.gz: 6a08dea5abb7a5622852363b527a3db69a47316fafa4f77d411325791a97a92db8a4e6b9b84cc0d2db837bdf32ccfbbfb811f66f83393e0be6315b17bcddf610
7
- data.tar.gz: 57355e42308801b4dbc25e936d9e2add1062200951847e5a029581d3756ef54bdde99e974852566fbc93431dac6a9b88c07a6c75920cf683068379d8b558982d
6
+ metadata.gz: 884d3b767545f81a4f20ee8aa57131fa5fc56d936e155075c81984e4fe02b67c442fd902cdfc6429657a2a86bb5f04a86c17848f530ef635e37c17467fe7885d
7
+ data.tar.gz: 39717a5271a2dcf3de6fc22163933c1897a77c6fe013a04d4715b5dfa7c739d2893760b4f38073a0cdec9965bd00d99f5a849fe9caf0f593b220ac8778065a42
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jievro-ast (0.4.0)
4
+ jievro-ast (0.5.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -47,8 +47,22 @@ module Jievro
47
47
  @value
48
48
  end
49
49
 
50
- def to_hash
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
@@ -1,5 +1,5 @@
1
1
  module Jievro
2
2
  module Ast
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jievro-ast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Azzalini