jsonbuilder 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- 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