Method: Megam::SnapshotsCollection.json_create

Defined in:
lib/megam/core/snapshots_collection.rb

.json_create(o) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
# File 'lib/megam/core/snapshots_collection.rb', line 101

def self.json_create(o)
  collection = self.new()
  o["results"].each do |snapshots_list|
    snapshots_array = snapshots_list.kind_of?(Array) ? snapshots_list : [ snapshots_list ]
    snapshots_array.each do |snapshots|
      collection.insert(snapshots)

    end
  end
  collection
end