lib/aggro/event_serializer.rb in aggro-0.0.3 vs lib/aggro/event_serializer.rb in aggro-0.0.4
- old
+ new
@@ -2,13 +2,13 @@
# Public: Converts events to and from serialized data.
module EventSerializer
module_function
def deserialize(serialized)
- Marshal.load serialized
+ Event.new(serialized[0], Time.parse(serialized[1]), serialized[2])
end
def serialize(deserialized)
- Marshal.dump deserialized
+ [deserialized.name, deserialized.occured_at.iso8601, deserialized.details]
end
end
end