Module: Seedable::Importer::ClassMethods
- Defined in:
- lib/seedable/importer.rb
Overview
Seedable methods for loading serialized objects of unknown or disperse types into objects.
Use from_seedable
here to load arrays of one or multiple types, or when you do not know what type of object the JSON represents to have it return the appropriate object.
Instance Method Summary collapse
-
#from_seedable(json) ⇒ Object
Takes JSON and builds objects from it.
Instance Method Details
#from_seedable(json) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/seedable/importer.rb', line 28 def from_seedable(json) objects = Helpers.parse_seedable(json) if Array === objects objects.map do |object| objects_from_serialized_hash(object) end else objects_from_serialized_hash(objects) end end |