jsonbuilder 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/builder/jsonmarkup.rb +1 -1
- data/lib/jsonbuilder.rb +1 -1
- metadata +1 -1
data/lib/builder/jsonmarkup.rb
CHANGED
@@ -24,6 +24,7 @@ module Builder
|
|
24
24
|
# NOTICE: you have to call this method to use array in json
|
25
25
|
def array_mode(&block)
|
26
26
|
@array_mode = true
|
27
|
+
eval("#{current} = []")
|
27
28
|
yield(self)
|
28
29
|
@array_mode = false
|
29
30
|
end
|
@@ -44,7 +45,6 @@ module Builder
|
|
44
45
|
|
45
46
|
def <<(_target)
|
46
47
|
if @array_mode
|
47
|
-
eval("#{current} ||= []")
|
48
48
|
eval("#{current} << _target")
|
49
49
|
else
|
50
50
|
eval("#{current} ||= {}")
|
data/lib/jsonbuilder.rb
CHANGED