lib/boom/storage/json.rb in boom-0.2.1 vs lib/boom/storage/json.rb in boom-0.2.2
- old
+ new
@@ -30,11 +30,11 @@
# Take a Json representation of data and explode it out into the consituent
# Lists and Items for the given Storage instance.
#
# Returns nothing.
def populate
- storage = JSON.parse(File.new(json_file, 'r').read)
+ storage = MultiJson.decode(File.new(json_file, 'r').read)
storage['lists'].each do |lists|
lists.each do |list_name, items|
@lists << list = List.new(list_name)
@@ -59,10 +59,10 @@
# Public: the Json representation of the current List and Item assortment
# attached to the Storage instance.
#
# Returns a String Json representation of its Lists and their Items.
def to_json
- JSON.generate(to_hash)
+ MultiJson.encode(to_hash)
end
end
end
end