Sha256: 97866f333f02e08eb83aa580157da1faf3e6d44d35f7791cf7be0d43162ea14e

Contents?: true

Size: 361 Bytes

Versions: 1

Compression:

Stored size: 361 Bytes

Contents

module Aggro
  # Public: Converts events to and from serialized data.
  module EventSerializer
    module_function

    def deserialize(serialized)
      Event.new(serialized[0], Time.parse(serialized[1]), serialized[2])
    end

    def serialize(deserialized)
      [deserialized.name, deserialized.occured_at.iso8601, deserialized.details]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aggro-0.0.4 lib/aggro/event_serializer.rb